Log in

View Full Version : Really Weird Problem...



KeepBotting
06-04-2012, 11:25 PM
Okay, so, here are my two procedures.

First one:procedure WalkRocks;
begin
WriteLn('Status: We are now on the surface of Crandor. Proceeding to adamant rocks.');
FindNormalRandoms;
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
SPS_Setup(RUNESCAPE_SURFACE,['7_9','7_8']);
WriteLn('Status: Found walkpath! Walking to rocks.');
WalkToRocks := [Point(3171, 3627), Point(3172, 3616), Point(3170, 3611), Point(3170, 3604), Point(3168, 3599), Point(3169, 3591), Point(3169, 3583), Point(3166, 3581), Point(3166, 3573), Point(3163, 3567), Point(3164, 3557), Point(3162, 3552), Point(3161, 3547), Point(3156, 3542), Point(3147, 3540), Point(3137, 3539), Point(3132, 3551), Point(3128, 3558), Point(3121, 3568), Point(3121, 3576), Point(3123, 3586), Point(3125, 3592), Point(3128, 3599), Point(3130, 3607), Point(3131, 3617), Point(3133, 3624), Point(3135, 3633), Point(3137, 3641), Point(3138, 3653), Point(3143, 3662), Point(3146, 3667), Point(3148, 3674), Point(3156, 3678), Point(3162, 3678), Point(3166, 3678), Point(3182, 3678)];
SPS_WalkPath(WalkToRocks);
Flag;
end;

Second one: procedure HopWorlds; //All credit for this procedure goes to I Am Legend.
var WorldNum: integer;
begin
WriteLn('Status: Hopping Worlds!');
FindNormalRandoms;
WriteLn('Status: Exiting to Lobby.');
ExitToLobby;
wait(500);
WriteLn('Status: Opening WorldScreen.');
OpenWorldScreen;
wait(500);
WriteLn('Status: Choosing random World.');
WorldNum := RandomWorld(false,false) ;
if (WorldNum = 106) then
WorldNum := RandomWorld(false,false) ;
if SelectWorld(WorldNum) then
WorldsHopped := WorldsHopped + 1;
WriteLn('Status: Logging back in!');
LoginPlayer;
end;

Okay, so my problem is that when running WalkRocks (and walking to the rocks) the script randomly runs HopWorlds for no reason whatsoever. I tried adding Flag; to tell the script to wait until the Flag disappears before doing anything else, but as soon as the Flag moves offscreen, HopWorlds runs.
Dafuq?

My mainloop:begin
Smart_Server := WORLD; //This sets up the SMART Minimizing Autoing Resource Thing.
Smart_Members := MEMBERS;
Smart_Signed := SIGNED;
Smart_SuperDetail := False;
SetupSRL; //This sets up SRL.

GetInfo; //This runs your GetInfo procedure, giving you information about this particular kbScript.
DeclarePlayers; //This runs your DeclarePlayers procedure, making sure that the script has a player to run.
LoginPlayer; //This logs in your player.

repeat
TeleSarim; //working but needs improvement
WalkBoat; //working
SailBoat; //working but needs improvement
CrossPlank; //working but needs improvement
WalkVolcano; //working
IntoVolcano; //working
WalkDoor; //undetermined
OpenDoor; //working
MeepMeep; //working but may need edited to improve ClimbRope
ClimbRope; //working but needs improvement
WalkRocks; //working
repeat
MineRock1; //working but needs tweaked
MineRock2; //working but needs tweaked
MineRock3; //working but needs tweaked
HopWorlds; //working
until InvFull; //working but it hops a world once before realising that invo is full lol wtf
TeleBank;
WalkBank;
GetBank;
DoBanking;
ProgressReport;
until AllPlayersInactive;
end.

What could be going wrong?

bg5
06-05-2012, 02:32 AM
when WalkRocks ends it immediately starts MineRockx. If it ends too early then propably rocks are not on the screen ,or player is still running ,so it can't find them. You don't have any failsafe so it will hop word regardless of rocks was mined or not.

KeepBotting
06-05-2012, 08:47 PM
when WalkRocks ends it immediately starts MineRockx. If it ends too early then propably rocks are not on the screen ,or player is still running ,so it can't find them. You don't have any failsafe so it will hop word regardless of rocks was mined or not.What kind of failsafe could I add? Flag; isn't working.

Abu
06-05-2012, 10:14 PM
Maybe it can't find the rocks so it assumes you've mined it and switches world.

Comment out HopWorlds and see if it actually mines the rocks.

KeepBotting
06-06-2012, 08:52 PM
Maybe it can't find the rocks so it assumes you've mined it and switches world.

Comment out HopWorlds and see if it actually mines the rocks.
It doesn't. DAFFUCK? What kind of failsafe could I add?

KeepBotting
06-08-2012, 11:03 AM
Bump!

P1ng
06-08-2012, 11:19 AM
It's hard to tell why it is moving on without seeing the rest of the code. perhaps add to your walking function something along these lines instead of Flag;

repeat
Inc(Counter);
Wait(RandomRange(800,1200));
until(not(IsMoving)) or (Counter > 10);

Don't know what your walking procedure looks like, but this should wait in ~1sec intervals until you stop moving or it has waited ~10sec before moving onto the next procedure.