Page 1 of 1

Starting Goblins error

Posted: Wed May 01, 2013 1:59 am
by ZZZZZ
Just trying to figure out why my goblins script keeps getting an error. It happens when you talk to the goblins just inside which will port you to the start.

The error:

Code: Select all

Moving to waypoint #8, (1994, 2219)
We try to find NPC Goblin Games Manager:
We successfully target NPC Goblin Games Manager and try to open the dialog windo
w.
Use MACRO: Executing RoMScript "ChoiceOption(1);".
Clearing target.
Moving to waypoint #9, (1994, 2219)
Use MACRO: Executing RoMScript "ChoiceOption(1);".
Did not find any crashed game clients.
4:38pm - [string "..."]:4: attempt to index a nil value


Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
The part of code where it gets the error:

Code: Select all

	<!-- #  1 --><waypoint x="1994" z="2219" y="310">		player:target_NPC("Goblin Games Manager");
		sendMacro("ChoiceOption(1);");
		yrest(1000);
		sendMacro("ChoiceOption(1);");
		yrest(1000):
		waitForLoadingScreen(1);
	</waypoint>
		<!-- #  1 --><waypoint x="2314" z="2251" y="312"> 	fly();	</waypoint>
Any help would be great :)

Re: Starting Goblins error

Posted: Wed May 01, 2013 2:54 am
by rock5

Code: Select all

Moving to waypoint #8, (1994, 2219)
. . .
Moving to waypoint #9, (1994, 2219)
Do you have 2 waypoints with the same coordinates? You only show one.

Also I'm not really familiar with goblins so a description of what it did, what you expected it to do and when it errored, will help.

Re: Starting Goblins error

Posted: Wed May 01, 2013 4:43 am
by kenzu38
Have you installed the swimhack userfunction? I don't know but looks like it's erroring at the fly command.

Re: Starting Goblins error

Posted: Wed May 01, 2013 4:59 am
by ZZZZZ
rock5 wrote:

Code: Select all

Moving to waypoint #8, (1994, 2219)
. . .
Moving to waypoint #9, (1994, 2219)
Do you have 2 waypoints with the same coordinates? You only show one.

Also I'm not really familiar with goblins so a description of what it did, what you expected it to do and when it errored, will help.
Oh sorry, I was fiddling with different things trying to get it to work. In that one I was using:

Code: Select all

	<!-- #  1 --><waypoint x="1994" z="2219" y="310">		player:target_NPC("Goblin Games Manager");
		sendMacro("ChoiceOption(1);");
		yrest(1000);
	</waypoint>
	<!-- #  1 --><waypoint x="1994" z="2219" y="310">
		sendMacro("ChoiceOption(1);");
		yrest(1000):
		waitForLoadingScreen(1);
	</waypoint>
		<!-- #  1 --><waypoint x="2314" z="2251" y="312"> 	fly();	</waypoint>
because without the extra waypoint it would instead say the same error except with Goblin Games Manager in the line as well.

What it is supposed to do is talk to the goblin manager then you get ported in to the other side of the wall which starts the game timer. Im assuming it has something to do with the co-ordinates that you are standing changing without a loading screen or new waypoint. *shrugs*
kenzu38 wrote:Have you installed the swimhack userfunction? I don't know but looks like it's erroring at the fly command.
I don't believe it is that because if I don't move and restart the waypoint it runs perfect from there on, the fly() command works fine.

Re: Starting Goblins error

Posted: Wed May 01, 2013 5:07 am
by kenzu38
Hmm, how about trying to wait longer? waitforloadingscreen(15).

Re: Starting Goblins error

Posted: Wed May 01, 2013 5:15 am
by ZZZZZ
kenzu38 wrote:Hmm, how about trying to wait longer? waitforloadingscreen(15).
I'll try that tomorrow seeing as I have no characters left to do it, but I don't think that would work, there isn't actually a loadingscreen, not even sure why I put it in there lol. I put it there in an attempt to fix the issue, was still doing the same thing before.

Re: Starting Goblins error

Posted: Wed May 01, 2013 5:24 am
by rock5
Ok, so the original posted error was probably because it cleared it's target between waypoints and then it tried to do a ChoiceOption with no target. Although I suspect the dialog would still be open so I'm not really sure why you would get the error.

With the original code you posted, maybe you just need to give it enough time to open the dialog.

Code: Select all

   <!-- #  1 --><waypoint x="1994" z="2219" y="310">      player:target_NPC("Goblin Games Manager");
      yrest(1000)
      sendMacro("ChoiceOption(1);");
      yrest(1000);
      sendMacro("ChoiceOption(1);");
      yrest(1000):
   </waypoint>

Re: Starting Goblins error

Posted: Wed May 01, 2013 5:34 am
by ZZZZZ
rock5 wrote:Ok, so the original posted error was probably because it cleared it's target between waypoints and then it tried to do a ChoiceOption with no target. Although I suspect the dialog would still be open so I'm not really sure why you would get the error.

With the original code you posted, maybe you just need to give it enough time to open the dialog.

Code: Select all

   <!-- #  1 --><waypoint x="1994" z="2219" y="310">      player:target_NPC("Goblin Games Manager");
      yrest(1000)
      sendMacro("ChoiceOption(1);");
      yrest(1000);
      sendMacro("ChoiceOption(1);");
      yrest(1000):
   </waypoint>
na it don't change it, that is why I cannot figure out why it is getting an error, everything is running properly, its opening the interface etc but still failing lol. i'll run the code I posted originally tomorrow and copy the error, its basically the same thing but with Goblin Games Manager in it.

Re: Starting Goblins error

Posted: Wed May 01, 2013 6:57 am
by dr-nuker

Code: Select all

       player:target_NPC("Goblin Games Manager");
       yrest(500)
       ChoiceOptionByName("Accept challenge")
       yrest(500)
       ChoiceOptionByName("Accept challenge")
       waitForLoadingScreen(5);
works fine for me.

Looks like you loose the Manager as target when the bot tries to pick a dialog, but as there is no box open it errors...

Re: Starting Goblins error

Posted: Wed May 01, 2013 7:06 am
by kenzu38
I wasn't really planning to fix my goblin mines script since it's not my main moneymaker anymore. Since I started using CleanMem, I can run way more clients at once so I moved from farming shells to farming KS. But when I opened the game earlier, there's an ongoing event involving shells so it gave me incentive to fix the script.

Anyway, just fixed my script and everything is working fine. These are the lines I added:

Code: Select all

	<waypoint x="1985" z="2214" y="310">
	player:target_NPC("Goblin Games Manager")
	yrest(1000)
      	sendMacro("ChoiceOption(1);")
      	yrest(1000)
      	sendMacro("ChoiceOption(1);")
      	yrest(2500)
	</waypoint>
	<waypoint x="2323" z="2199" y="311">
	speed(60)
	fly()
	</waypoint>
It's almost the same as the ones posted here so I don't know what's keeping your script from working.

All I can think of now though is if you like to tweak files used by the bot, then there's probably something there creating a conflict. I remember before, I kept on getting errors coz of some codes I added into my profile.

EDIT: Even tried it without the yrest(2500), and it still worked fine for me.