Page 1 of 2

Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sat Oct 12, 2013 11:34 am
by BeyondNames
I was just farming and i came back to my PC with this error the error did not occur right away when i started the WP

Code: Select all

Use MACRO: MAGE_ELEMENTAL_WEAKN=>   * Failed to cast *
The game client did not crash.
9:59pm - ...Files (x86)/ROM PVP/micromacro/scripts/rom/functions.lua:2298: attem
pt to perform arithmetic on local 'endloc' (a nil value)


AL lib: FreeContext: (027CCCC8) Deleting 1 Source(s)
Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
Any help would be greatly appreciated :)

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sat Oct 12, 2013 11:53 am
by rock5
It has something to do with either getTEXT() or getCurrency() functions, neither of which the bot uses. Do you use one of those functions in your waypoint file? Maybe there is something wrong with the way you are using it.

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sun Oct 13, 2013 11:58 am
by BeyondNames
The only functions I'm using is set window count players and log into different char

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sun Oct 13, 2013 12:09 pm
by BeyondNames
Just got this

Code: Select all

MicroMacro v1.03
SolarStrike Software
http://www.solarstrike.net
Opening bot.lua...
Starting script execution - Press CTRL+C to exit.
Press CTRL+L to cancel execution and load a new script.
-------------------------------------------------------------------------------
Installing userfunctions.
We read the hotkey settings from your bindings.txt file C:\Users\----\My Document
s\Runes of Magic\bindings.txt instead of using the settings.xml file.
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
ññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññññ
Welcome to rom bot! press END to quitñññññññññññññññññññññññññññññññññññññ
RoM Bot Version 3.29, Revision 761ññññññññññññññññññññññññññññññññññññññññ
Press the (End) key to stop/pause the script.
You can resume with the (Delete) key.
Game Version is 6.0.2.2662
RoM windows size is 1920x1028, upper left corner at 0,22
Loading profile Trorlea.xml
Testing 'ingamefunctions' macro. If it gets stuck here, please update the 'ingam
efunctions' by copying the 'ingamefunctions' folder from 'rom/devtools' to the g
ames 'interface/addons' folder.
MACRO Test: ok
Ranged skill found: MAGE_ELEMENTAL_WEAKNESS
[DEBUG] CPU Frequency 4101.757
Waypoint files from C:/Program Files (x86)/ROM PVP/micromacro/scripts/rom:
  0: wander                  1: #1DogMeat.xml          
Enter the number of the path you want to use and press Enter > 1
You chose 1
Loaded waypoint path #1DogMeat.xml
No return path with default naming #1DogMeat_return.xml found.
We use the normal waypoint path #1DogMeat.xml now.
Waypoint #59 is closer then #1. Hence we start with waypoint #59.
Moving to waypoint #59, (6438, 4343)
Stopping waypoint: Target acquired before moving.
Engaging enemy [Inferno Guard Dog] in combat.
Moving in | Suggested range: 250 | Distance: 375
Use MACRO: MAGE_ELEMENTAL_WEAKN=>   Inferno Guard Dog (3242/3242)
Use MACRO: MAGE_ELEMENTAL_CATAL=>   Inferno Guard Dog (3242/3242)
Use MACRO: MAGE_ENERGY_INFLUX  =>   Inferno Guard Dog (3242/3242)
Use MACRO: MAGE_ENERGY_WELL    =>   * Failed to cast *
The game client did not crash.
[b]10:5am - ...Files (x86)/ROM PVP/micromacro/scripts/rom/functions.lua:2298: attem
pt to perform arithmetic on local 'endloc' (a nil value)[/b]


AL lib: FreeContext: (0268CCC8) Deleting 1 Source(s)


I was using the attached WP

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sun Oct 13, 2013 12:34 pm
by rock5
I think I know where it's happening. Both times I see it happened when it failed to cast. When it fails to cast it checks for any system messages about line o sight and facing the target errors. It uses getTEXT to get your local error message. I still don't know why you are getting the error but I noticed your line numbers don't match up with mine. Are any of your files corrupted? Do any of the files have red or yellow icons next to them in Explorer? If so try doing an svn revert on the rom folder. Or are you using an older version of the bot?

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sun Oct 13, 2013 12:41 pm
by BeyondNames
The address file had a red icon/ exclamation point so i reverted it now there are no files with red icons
im gonna try it again see if it works

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sun Oct 13, 2013 12:48 pm
by BeyondNames
Its worked so far but once i started the bot it automatically updated and the address file icon went red again but it seems to be working ill update you if anything goes wrong
thx

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sun Oct 13, 2013 1:02 pm
by rock5
addresses.lua might legitimately be red if you are using a version of the game that requires the addresses updated. Still, it may have had some corruption so it might have fixed it. If you see "Failed to cast" and it still works then it probably is fixed.

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sun Oct 13, 2013 1:11 pm
by BeyondNames
got the same thing but...

Code: Select all

MicroMacro v1.03
SolarStrike Software
http://www.solarstrike.net
Opening bot.lua...
Starting script execution - Press CTRL+C to exit.
Press CTRL+L to cancel execution and load a new script.
-------------------------------------------------------------------------------
Installing userfunctions.
Enter the number of the path you want to use and press Enter > 1
You chose 1
Loaded waypoint path #1DogMeat.xml
No return path with default naming #1DogMeat_return.xml found.
We use the normal waypoint path #1DogMeat.xml now.
Waypoint #5 is closer then #1. Hence we start with waypoint #5.
Moving to waypoint #5, (6345, 4456)
Stopping waypoint: Target acquired before moving.
Engaging enemy [Inferno Guard Dog] in combat.
Moving in | Suggested range: 250 | Distance: 283
Use MACRO: MAGE_ELEMENTAL_WEAKN=>   Inferno Guard Dog (3242/3242)
Use MACRO: MAGE_ENERGY_WELL    =>   Inferno Guard Dog (3242/3242)
Use MACRO: MAGE_FIREBALL       =>   Inferno Guard Dog (363/3242)
Use MACRO: MAGE_THUNDERSTORM   =>   * Failed to cast *
The game client did not crash.
11:9am - ...Files (x86)/ROM PVP/micromacro/scripts/rom/functions.lua:2298: attem
pt to perform arithmetic on local 'endloc' (a nil value)


AL lib: FreeContext: (0274CCC8) Deleting 1 Source(s)
Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sun Oct 13, 2013 1:17 pm
by rock5
What version of the game and bot are you using? The game should be something like 6.x.x and the bot should be something like 766.

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sun Oct 13, 2013 2:25 pm
by BeyondNames
Rombot version 3.29 Revision 761 and rom pvp is 6.0.2.2662.en

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sun Oct 13, 2013 10:26 pm
by rock5
getText was updated in 763. Try doing an svn update.

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Thu Oct 17, 2013 10:03 pm
by BeyondNames
K will do I've been busy so I'll try to get back to ya by the weekend

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Fri Nov 01, 2013 5:14 pm
by BeyondNames
im at revision 766 now so im gonna try it again
Sry it took me so long to continue to fix this problem ive been extremely busy
I havnt even turned the computer on since last time i responded to this topic

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sat Nov 09, 2013 11:47 am
by Romplayer
I am getting the exact same error
revision 766
I happens when it targets a mob to kill but there happens to be a obstacle in the way of casting and attack.

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sat Nov 09, 2013 12:15 pm
by rock5
Do you have any corrupt files? Files with red or yellow icons next to them in explorer (excluding addresses.lua which should be red at this stage)? Is the error message exactly the same? Same line number and everything? Are you using the latest micromacro?

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sat Nov 09, 2013 12:28 pm
by Romplayer
Same line number error, no reds. MM v 1.03

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sat Nov 09, 2013 12:44 pm
by rock5
Hm.. Could you have a look at what's on line 2298 of functions.lua?

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sat Nov 09, 2013 2:22 pm
by Romplayer

Code: Select all

function getTEXT(text)
	local function memoryGetTEXT(str)
		local addressPtrsBase = memoryReadInt(getProc(), addresses.getTEXT)
		local startloc = memoryReadInt(getProc(), addressPtrsBase + 0x268)
		local endloc = memoryReadInt(getProc(), addressPtrsBase + 0x26C)
		local quarter = math.floor((endloc-startloc) / 4)

		local tmpStart = endloc
		local tmpEnd = endloc
		-- Find which quarter of memory holds string to speed up search
		for count = 1,3 do
			tmpStart = tmpStart - quarter
			local found = findPatternInProcess(getProc(), string.char(0).."Sys", "xxx", tmpStart, tmpEnd);
			local tmpText = memoryReadString(getProc(), found + 1)
			if tmpText <= str then
				startloc = tmpStart
				break
			else
				endloc = tmpStart
			end
		end
		local searchlen = endloc - startloc

		local pattern = string.char(0x00) .. str .. string.char(0x00)
		local mask = string.rep("x", #pattern)
		local offset = #pattern
		local found = findPatternInProcess(getProc(), pattern, mask, startloc, searchlen);

		if found ~= 0 then
			return memoryReadString(getProc(), found + offset)
		else
			return str
		end
	end

	if not text or type(text) ~= "string" then return end
	local resultTEXT = memoryGetTEXT(text)
	for subTEXT in string.gmatch(resultTEXT,"%[(.-)%]") do
		local translatedSubTEXT
		if tonumber(subTEXT) then -- Must be id
			translatedSubTEXT = GetIdName(tonumber(subTEXT))
		else
			translatedSubTEXT = memoryGetTEXT(subTEXT)
		end
		if translatedSubTEXT ~= nil and translatedSubTEXT ~= subTEXT then
			resultTEXT = string.gsub(resultTEXT, "%["..subTEXT.."%]", translatedSubTEXT)
		end
	end

	return resultTEXT
end
Heres the gettxt in my functions.lua I don't have a lua editor so I would have to count 2290ish or so lines so I don't know which is exactly line 2298

Re: Error stating arithmetic on local 'endloc' (a nil value)

Posted: Sat Nov 09, 2013 7:29 pm
by Bill D Cat
Romplayer wrote:Heres the gettxt in my functions.lua I don't have a lua editor so I would have to count 2290ish or so lines so I don't know which is exactly line 2298
Edit the file in Notepad and turn on the status bar to see line numbers, or better yet, download Notepad++ and enjoy the extra features like syntax highlighting and more. http://notepad-plus-plus.org/