Results 1 to 15 of 15

Thread: Error: Invalid jump in script?

  1. #1
    Join Date
    Jun 2007
    Location
    NSW, Australia.
    Posts
    541
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Error: Invalid jump in script?

    Yes, I am using the dreaded goto, but I could see no other way of doing it. Anyway, I'm using this code:

    SCAR Code:
    repeat
    featherbuying:
          Wait(100 + Random(50));
          FeathersBought := FeathersBought + BuyFeathers;
          if (GetSystemTime - TimePlayed * 100 = TimePerPlayer) then Break;
          if (featherstobuy = 0) then goto featherbuying;
        until(FeathersBought >= FeathersToBuy) or (GetSystemTime - TimePlayed * 100 = TimePerPlayer);

    Buy feathers is a function that returns an integer.
    I have got featherbuying declared as a label.

    Thanks, Pancakes.
    Quote Originally Posted by RAM View Post
    I sam sofa king wee todd did ! ~RAM
    My SRL Army Blog.


  2. #2
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    You mean FeatherBuying is a label?
    I think goto is used for procs?
    Lets see I test...
    Lol couldnt find out the usage... Wait till others..

  3. #3
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    You can't jump in and out of loops with a goto.

  4. #4
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    repeat
      featherbuying:
      Wait(100 + Random(50));
      FeathersBought := FeathersBought + BuyFeathers;
      if (GetSystemTime - TimePlayed * 100 = TimePerPlayer) then Break;
      if (featherstobuy = 0) then break;
    until(FeathersBought >= FeathersToBuy) or (GetSystemTime - TimePlayed * 100 =   TimePerPlayer);
      featherbuying;

    Something like that?
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  5. #5
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Not quite. This should do it:
    SCAR Code:
    featherbuying:
    repeat
      Wait(100 + Random(50));
      FeathersBought := FeathersBought + BuyFeathers;
      if (GetSystemTime - TimePlayed * 100 = TimePerPlayer) then Break;
      if (featherstobuy = 0) then break;
    until(FeathersBought >= FeathersToBuy) or (GetSystemTime - TimePlayed * 100 =   TimePerPlayer);
      if(featherstobuy = 0)then goto featherbuying;

    (I read the script wrong on my first post. You can't jump when INSIDE a loop either)

  6. #6
    Join Date
    Jun 2007
    Location
    NSW, Australia.
    Posts
    541
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks.
    I wonder why that is?

    Anyway, why we're still on the same boat, this is not working either

    SCAR Code:
    function FeatherAmount : Integer;
    var x, y : Integer;
    begin
      if (Not(LoggedIn)) then Exit;
      if (FindDTM(FeatherDTM, x, y, MSX1, MSY1, MSX2, MSY2)) then
      begin
        Result := AmountDtm('shop', FeatherDTM);
        Writeln('Shop has ' + inttostr(result) + ' feathers.');
        Exit;
      end;
      Result := 0;
    end;

    It always returns 0, and writes 'Shop has 0 feathers.'
    Is the function amountdtm broken?

    -Pancakes.
    Quote Originally Posted by RAM View Post
    I sam sofa king wee todd did ! ~RAM
    My SRL Army Blog.


  7. #7
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    have you gotten the updated amount.scar? Go here


  8. #8
    Join Date
    Jun 2007
    Location
    NSW, Australia.
    Posts
    541
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by bobarkinator View Post
    have you gotten the updated amount.scar? Go here
    I've got it.
    Quote Originally Posted by RAM View Post
    I sam sofa king wee todd did ! ~RAM
    My SRL Army Blog.


  9. #9
    Join Date
    Feb 2006
    Location
    Locked in RAM's closet !
    Posts
    2,001
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    did you load featherDTM into memory before you ask to search for the DTM?
    Darky has stopped by to say hello :).
    10-21-2010
    Updated-
    10-09-2012

  10. #10
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    It would give him a runtime error if he didn't.

  11. #11
    Join Date
    Feb 2006
    Location
    Locked in RAM's closet !
    Posts
    2,001
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    then what is his exact error?


    and it always returns 0 maybe his dtm / bmp is not correct or something...
    Darky has stopped by to say hello :).
    10-21-2010
    Updated-
    10-09-2012

  12. #12
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,347
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    You sure that AmountDTM returns stacked amounts?
    Interested in C# and Electrical Engineering? This might interest you.

  13. #13
    Join Date
    Feb 2006
    Location
    Locked in RAM's closet !
    Posts
    2,001
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    thought the same thing smartz but then it should return 1 atleast?


    its like his dtm is not working and just skipping to result to 0....


    heres a new dtm test it out :

    SCAR Code:
    := DTMFromString('78DA637466666060606200016606285065601' +
           '001528C30EC0194F9C688A266DBEAD5703520C0180894F984AA06' +
           '248B620EC8AE2FF8D50000091306A7');
    Darky has stopped by to say hello :).
    10-21-2010
    Updated-
    10-09-2012

  14. #14
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Nah I tested it on a working DTM already. It's broken. It looks like they squished the shop screens...

  15. #15
    Join Date
    Feb 2006
    Location
    Locked in RAM's closet !
    Posts
    2,001
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    make a bitmap and tell it to look for a deformed bitmap and it should find it.
    Darky has stopped by to say hello :).
    10-21-2010
    Updated-
    10-09-2012

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Invalid Jump
    By orange in forum OSR Help
    Replies: 2
    Last Post: 10-09-2008, 07:51 PM
  2. Error: Invalid jump in script.
    By Pancakes in forum OSR Help
    Replies: 2
    Last Post: 08-29-2007, 01:26 PM

Posting Permissions

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