Results 1 to 4 of 4

Thread: Why does this log me out..?

  1. #1
    Join Date
    Dec 2006
    Posts
    374
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Why does this log me out..?

    hey guys sorry for asking another newb question.. but i cant figure this one out. in my previous thread i got it 2 work with arrays =] w00t. but now i want to to switch players if theres not enough runes to cast the spell so i did this.
    SCAR Code:
    procedure zammymage;
    var
     Spell : String;
    begin

    case wichspell of
      0: Spell:='Confuse';
      1: Spell:='Weaken';
      2: Spell:='Curse';
    end;
     Wait(300+random(200));
      Wait(200+random(200));
      for ZMageI := random(6 + 3)
      ZCastOn(Spell,'amora',ZMage[ZMageI],5);
      if(not(ZCastOn(Spell,'amora',ZMage[ZMageI],5))) then
      writeln('Not enough runes left to cast!')
      nextplayer(False);
      howmany := howmany+1;
     if(howmanyto=howmany) then
      NextPlayer(False);
    end;

    and that logs me out and switches even if i have enough rune to cast.. ? =/

    o and its not cuz of the ZMageI := Random(9) cuz that works just fine the way i want it to. but when i add the if(not(ZCastOn.. thats when it messed up.
    Another awsome scripting forum! Check it out: www.Uberbroproductions.net/forums
    TRY MY VARROCK ZAMMY MAGE CURSER/CONFUSER/WEAKENER! THE LINK IS BELOW
    http://www.srl-forums.com/forum/varr...56.html?t=6356
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~


  2. #2
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    When you want to do more than 1 line in an if you need begin end

    if condition then
    begin
    part1;
    part2;
    end;
    That will do part1 and part2 on the condition


    This will do part1 on the condition, and part 2 all the time
    if condition then
    part1;
    part2;

  3. #3
    Join Date
    Dec 2006
    Posts
    374
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure zammymage;
    var
     Spell : String;
    begin

    case wichspell of
      0: Spell:='Confuse';
      1: Spell:='Weaken';
      2: Spell:='Curse';
    end;
     Wait(300+random(200));
      Wait(200+random(200));
       ZMageI := random(6 + 3)
      ZCastOn(Spell,'amora',ZMage[ZMageI],5);
      if(not(ZCastOn(Spell,'amora',ZMage[ZMageI],5))) then
      begin
      writeln('Not enough runes left to cast!')
      nextplayer(False);
      end
      howmany := howmany+1;
     if(howmanyto=howmany) then
      NextPlayer(False);
    end;

    so this would work?
    Another awsome scripting forum! Check it out: www.Uberbroproductions.net/forums
    TRY MY VARROCK ZAMMY MAGE CURSER/CONFUSER/WEAKENER! THE LINK IS BELOW
    http://www.srl-forums.com/forum/varr...56.html?t=6356
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~


  4. #4
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Yes. It should, in theory.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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
  •