Results 1 to 7 of 7

Thread: Really Weird Problem...

  1. #1
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default Really Weird Problem...

    Okay, so, here are my two procedures.

    First one:
    Simba Code:
    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:
    Simba Code:
    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:
    Simba Code:
    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?
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  2. #2
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    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.

  3. #3
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by beginner5 View Post
    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.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  4. #4
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    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.

  5. #5
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    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?
    Last edited by KeepBotting; 06-06-2012 at 08:56 PM.
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  6. #6
    Join Date
    Dec 2011
    Location
    East Coast, USA
    Posts
    4,231
    Mentioned
    112 Post(s)
    Quoted
    1869 Post(s)

    Default

    Bump!
    GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!

    <BenLand100> we're just in the transitional phase where society reclassifies guns as Bad™ before everyone gets laser pistols

  7. #7
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    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;

    Simba Code:
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •