Results 1 to 7 of 7

Thread: Can't get worldhopper to make the 'jump'

  1. #1
    Join Date
    Nov 2011
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default Can't get worldhopper to make the 'jump'

    So I have a world hopping procedure that works just fine, until I hit a break in the world numbers (306 to 309, 314 to 317, etc.)
    Code:
    Procedure WorldHop;
    var
      CWorld:integer;
    Begin
      CWorld:= CurrentWorldLS;
      If (FullWorld(CWorld+1)) then
      begin
        SelectWorld(CWorld+2)
      end else
        SelectWorld(CWorld+1);
    End;
    Basically what will happen is it will hit 306 and the script will stop and ** Warning in SelectWorld: Invalid World ** shows up in the debug box. Anyone know how to get around this little problem. Thanks.

    Edit: Forgot to mention I'm using the OSR worldswitcher https://raw.github.com/SRL/SRL-OSR/m...switcher.simba
    Last edited by i_liek2feesh; 03-16-2013 at 11:02 AM.

  2. #2
    Join Date
    Nov 2011
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Well I'm using the OSR worldswitcher https://raw.github.com/SRL/SRL-OSR/m...switcher.simba
    Code:
    function SelectWorld(W: integer): boolean;
    var
      i,t: integer;
      validworld : boolean;
      worldbox: tbox;
    begin
      result := currentworldls = w;
      if result then
        exit;
    
      if Length(WorldArray) < 1 then
        worldarray :=
        [301,320,341,360,+
         302,321,342,361,+
         303,322,343,362,+
         304,325,344,365,+
         305,326,345,366,+
         306,327,346,367,+
         309,328,349,368,+
         310,329,350,369,+
         311,330,351,370,+
         312,333,352,373,+
         313,334,353,374,+
         314,335,354,375,+
         317,336,357,376,+
         318,337,358,377,+
         319,338,359,378];
      for i:=0 to high(worldarray) do
      begin
        if worldarray[i]=W then
        begin
          arraynumber := i;
          validworld := true;
          break;
        end
      end;
    
      if not validworld then
      begin
        srl_Warn('SelectWorld', 'Invalid World', warn_AllVersions);
        ExitWorldScreen;
        Exit;
      end;
    
      if OpenWorldScreen then
      begin
        worldbox:= FindWorld(I);
        if worldbox.x1 = 0 then
        begin
          ExitWorldScreen;
          exit;
        end;
        mousebox(worldbox.x1,worldbox.y1,worldbox.x2,worldbox.y2,mouse_left);
        result:=true;
      end;
    
      marktime(t);
      repeat
        wait(randomrange(400,500));
        if timefrommark(t)>6000 then
        begin
          ExitWorldScreen;
          exit;
        end;
      until not worldscreen;
    
      wait(randomrange(400,500));
      if (not(Result)) then TypeByte(vk_Escape);
    end;
    But anyways I was thinking that I could use it as a function, write another one that would compensate for the the jump (+3/+4 instead of +1/+2). But then I have no idea how I would write a new world hopper that would differentiate between which one it would call. Like I've tried setting it up as a case, but it wouldn't work.

    Or is there a way that I can get it to go to the next unfull/valid world. I doubt that something as simple as SelectWorld(Next) would work. lol
    Last edited by i_liek2feesh; 03-16-2013 at 11:10 AM.

  3. #3
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    worldarray is an array - just have it select the next world in the array. Don't have time to write out the code but it would be something like worldarray[currentworldarraynumber+1]. It gives you the invalid thing b/c there are some worlds that don't exist in 07 (there are a few skips in the world number)

  4. #4
    Join Date
    Nov 2011
    Posts
    31
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Ashaman88 View Post
    worldarray is an array - just have it select the next world in the array. Don't have time to write out the code but it would be something like worldarray[currentworldarraynumber+1]. It gives you the invalid thing b/c there are some worlds that don't exist in 07 (there are a few skips in the world number)
    Code:
    Procedure WorldHop;
    var
      currentworldarraynumber:integer;
      worldarray: array [0..59] of integer;
    begin
      If (FullWorld(worldarray[currentworldarraynumber+1])) then
        Begin
          SelectWorld(worldarray[currentworldarraynumber+2])
        end else
          SelectWorld(worldarray[currentworldarraynumber+1]);
    end;
    So something like that? Because I keep running into the same error. should I be declaring currentworldarraynumber as something different?

  5. #5
    Join Date
    Feb 2013
    Posts
    37
    Mentioned
    0 Post(s)
    Quoted
    19 Post(s)

    Default

    I made my own that is not as sophisticated but it works all the same. It doesn't use actual world numbers because that is unimportant, it just goes to the next world. No failsafe, so i just set it to go world 10-63 because they are never full.
    Simba Code:
    procedure World;
    begin
      mmouse(62,482, 5, 5);
      ClickMouse2(mouse_left);
      writeln('winning');
        worldnum := worldnum+1
        if (worldnum < 19)then
          mmouse(245, (260+(worldnum-11)*25),0,0);
         wait(200);

        if ((worldnum <34) and (worldnum > 18)) then
          mmouse(330, (88+(worldnum-19)*24),0,0);
        wait(200);
        if ((worldnum <49) and (worldnum > 33)) then
          mmouse(420, (88+(worldnum-34)*24),0,0);
        wait(200);
        if ((worldnum <64) and (worldnum > 48)) then
          mmouse(515, (88+(worldnum-49)*24),0,0);
        wait(200);
        if (worldnum > 63) then
          begin
            worldnum := 10
            World;
          end;
        wait(200);
        ClickMouse2(mouse_left);
        writeln(inttostr(worldnum));
    end;
    If you wanted random world just change worldnum := 1+worldnum to worldnum := randomrange(10,63)
    I know this is probably not the best way to do things, but it works.

  6. #6
    Join Date
    Feb 2013
    Location
    Waterloo, Ontario
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Deleting the normal high population worlds (1, 2, 5, 6, 9, 10 and whatever else) out of the worldarray would be a effective but temporary fix

    Edit: Nvm, I thought you were talking about skipping full worlds. Selecting the next element in the array should fix your problem:
    You can declare worldarray as a global variable and then do this:

    Simba Code:
    Procedure WorldHop;
    var
      WorldArrayIndex:integer;
    begin
      WorldArrayIndex:= 0;

      repeat
        If (FullWorld(worldarray[WorldArrayIndex+1])) then
          SelectWorld(worldarray[WorldArrayIndex+2])
        else
          SelectWorld(worldarray[WorldArrayIndex+1]);

        WorldArrayIndex := WorldArrayIndex + 1;
      until (WorldArrayIndex = high(worldarray))
    end;

    This would enumerate through all the array once, if you wanted to do it again just set another loop around it.
    Last edited by hsxu; 03-20-2013 at 01:49 PM.

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
  •