Page 1 of 1

Error: memoryReadInt (number, expected, got nil)

Posted: Sun Jun 09, 2013 5:55 am
by haringpb
Hey there since updating rom bot on 758 (i guess) i get bad argument in memoryReadInt (number, expected, got nil), when loading my Andor script

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<waypoints>
	<onLoad>

	
		-- V 3.7
		<![CDATA[
		
			--=== user options ===--
			-- it will stop once this score is reached, bonuses will be added afterwards though 
			-- so 2700 will probably be total score of 3100
			local requiredscore = 9000
			
			-- alter to your local language, caps sensative, in english is "Go!!!", so "Go" is enough
			local goMessage = "Go"		
		

			for k,v in pairs(settings.profile.skills) do
				v.AutoUse = false
			end

			id_kate		= 121035
			id_magelly	= 120687

			-- Move to Kate Wesker and enter
			if getZoneId() == 2 then
				repeat
					yrest(500)
				until player:target_NPC(id_kate)

				repeat
					yrest(500)
				until ChoiceOptionByName(getTEXT("SKWERL_MOBIUS_24")) 

				yrest(1000)
				waitForLoadingScreen()
			end
			
			-- Move to Magelly Basac
			repeat
				yrest(500)
			until player:target_NPC(id_magelly)

			-- Check if we already completed
			repeat
				yrest(500)
			until ChoiceOptionByName(getTEXT("SKWERL_MOBIUS_14")) 
			
 
			repeat
				yrest(500)
			until ChoiceOptionByName(getTEXT("SKWERL_MOBIUS_25")) 
			

			repeat
				yrest(500)
			until ChoiceOptionByName(getTEXT("SYS_OKAY")) 
			yrest(1000)

			local round = 0
			local score = 0

			function tort()
				local proc = getProc()
				
				local function checkclicked(address)
					local tmp = memoryReadRepeat("int", proc, address + addresses.pawnAttackable_offset) or 0;
					if bitAnd(tmp,0x8) then
						return true
					else
						return false
					end
				end

				local function one(ID)
					--print("targeting: "..ID)
					local objectList = CObjectList();
					objectList:update();
					local objSize = objectList:size()
					for i = 0,objSize do 
						obj = objectList:getObject(i)
						obj:update()
						if (obj.Id == ID or ID == 106885) and checkclicked(obj.Address) then
							player:target(obj)
							RoMScript("UseExtraAction(1)")
							yrest(10)
							player:target(obj)
							RoMScript("UseExtraAction(1)")
							if ID == 106883 then
								yrest(10)
								player:target(obj)
								RoMScript("UseExtraAction(1)")	
							end
							yrest(100)
						end
					end
				end
				if player:findNearestNameOrId(106881,106882,106883,106884) then
					--== monitor chat
					EventMonitorStart("Tortevent", "SYSTEM_MESSAGE");
					local time, moreToCome, name, msg, _go 
					repeat
						time, moreToCome, name, msg = EventMonitorCheck("Tortevent",1)
						yrest(10)
						if name and string.find(name,goMessage) then
							_go = true
						end
					until _go == true
					EventMonitorStop("Tortevent")
					round = round + 1
					print("Wave: "..round..", Score: "..score)
					repeat
						one(106882)
						one(106882)
						one(106882)
						one(106881)
						one(106883)
						one(106884)
					until not player:findNearestNameOrId(106881,106882,106883,106884)
				end
			end

			repeat
				yrest(100)
			until  player:findNearestNameOrId(106881)
			print("OK event has started")
			repeat
				tort()
				player:update()
				yrest(100)
				buffed = player:getBuff(622402)
				if buffed then score = buffed.Level end
			until not player:hasBuff(622402) or ( buffed and buffed.Level > requiredscore )
			yrest(5000)
			sendMacro("CloseWindows()")
			player:target_NPC("Magelly Basac")
			yrest(10000)
			RoMScript("ChoiceOption(1)")
			yrest(1999)
			sendMacro('StaticPopup_OnClick(StaticPopup1, 1);')
			waitForLoadingScreen();
			player:update();
		        loadPaths("Course_of_Terror_Wp.xml");
		]]>
	</onLoad>
</waypoints>
It get the error when opening the dialog window to go into andor.
Hoping for your help haringpb ;)

Re: Error: memoryReadInt (number, expected, got nil)

Posted: Sun Jun 09, 2013 6:10 am
by rock5
Please copy the whole error message including line number. For instructions on how to copy and paste in MM check my signature.

Re: Error: memoryReadInt (number, expected, got nil)

Posted: Sun Jun 09, 2013 6:25 am
by haringpb
.../script/rom/functions.lua:2311: bad argument #2 to 'memoryReadInt' (number expeced, got nil)

is the error report i got.

Re: Error: memoryReadInt (number, expected, got nil)

Posted: Sun Jun 09, 2013 6:46 am
by rock5
As I suspected it has something to do with the new getText function but I don't get it . 'argument #2' is addresses.getTEXT which does exist so why does yours say it equals nil? Try starting the commandline and typing a few test commands eg.

Code: Select all

print(addresses.getText)
print(getTEXT("SKWERL_MOBIUS_24"))

Re: Error: memoryReadInt (number, expected, got nil)

Posted: Sun Jun 09, 2013 7:00 am
by haringpb
ok print(addresses.getText) gets me nil and the secound task returns the error postet earlier.
Should there be an getText in addresses.lua? because there is none for me.

Re: Error: memoryReadInt (number, expected, got nil)

Posted: Sun Jun 09, 2013 7:56 am
by rock5
You might have got a conflicted file when doing SVN update. Please don't ignore conflicts. Try doing an SVN revert on addresses.lua and any other conflicted files.

Re: Error: memoryReadInt (number, expected, got nil)

Posted: Sun Jun 09, 2013 9:20 am
by haringpb
allright after making new rom folder making svn upadte and coping the addresses.lua into my old folder it finaly works thanks a lot.

Re: Error: memoryReadInt (number, expected, got nil)

Posted: Sun Jun 09, 2013 9:54 am
by rock5
All you had to do was right-click the addresses.lua file and select "TortoiseSVN/Revert".

Re: Error: memoryReadInt (number, expected, got nil)

Posted: Sun Jun 09, 2013 10:20 am
by haringpb
No i did so first, but didnt work. Anyhow its working as it should now ;)