ScriptUO

Scripting Resources & Utilities => Stealth Client => Stealth archive => Topic started by: drmorpheus on June 26, 2015, 02:03:50 PM

Title: Problem with var boolean script casting
Post by: drmorpheus on June 26, 2015, 02:03:50 PM
Hi Guys i got a problem with a script, could someone trying to help me to fix this?
It's annoying,  i tried to do it in many different way but nothing change.
When i press the Hotkey it doesn't work good.

Thanks in advance to everybody

Kind Regards  Grin

Here the script:

Code: [Select]
procedure cast_spam();
var IsCasting:Boolean;
var arrow:Boolean;
begin
    arrow:=False;
    if not IsCasting then begin        
        if (arrow = False) then begin
        IsCasting:=True
        cast ('Magic_Arrow');
        WaitForTarget(500);
        if targetpresent then begin
          TargetToObject(LastAttack);
          IsCasting:=False;
          arrow:=True;
          end;
        end;
  
        if (arrow = True) then begin
        IsCasting:=True;
        cast ('Fireball');
        WaitForTarget(500);
        if targetpresent then begin
          TargetToObject(LastAttack);
          IsCasting:=False;        
          arrow:=False;
          end;
        end;
    end;
End;
   
Title: Re: Problem with var boolean script casting
Post by: Boydon on June 27, 2015, 02:35:32 AM
When i press the Hotkey it doesn't work good.

Can you elaborate "it doesn't work good"? What is the problem?
Title: Re: Problem with var boolean script casting
Post by: drmorpheus on June 27, 2015, 04:40:34 AM
OK sorry,  if I  hold the bottom it should cast first magic arrow and then fireball,  but it cast not in the right way. The script cast magic arrow  many times then just a time fireball but the spell flizz many times..

Thanks in advance
Title: Re: Problem with var boolean script casting
Post by: drmorpheus on June 27, 2015, 06:28:13 AM
fixed, just used some while and deleted  IF ;)
Title: Re: Problem with var boolean script casting
Post by: Crome969 on June 28, 2015, 01:01:08 AM
I wrapped your code with Code-Tag. Better for reading..
Title: Re: Problem with var boolean script casting
Post by: drmorpheus on July 02, 2015, 05:44:29 AM
thank you man,
anyway guys i tought that the script was already fixed but i commit mistake, it doesn't work..

can someone help me?

please i really need it..
Title: Re: Problem with var boolean script casting
Post by: Crome969 on July 02, 2015, 10:26:42 AM
i never used the hotkey interface but asked Vizit0r who wroted this like 2 years ago. He doesnt remember as well. You may check on Stealth.od.ua onto forum,maybe someone posted samples how to get hotkeys working. I myself got your snippet not working, so i couldnt debug it.