ChatScape
ChatScape's Official Chat Forum.
HomePortalGalleryCalendarFAQSearchRegisterLog in
Post new topic   Reply to topic
 

Goto command

View previous topic View next topic Go down 
AuthorMessage
Shaimus




Joined : 12 Jul 2008
Posts : 10

PostSubject: Goto command   Sun Jul 13, 2008 4:49 pm

I was trying to make a flooding script. Just as a test for using the goto command. Infinite loop, that kinda thing.

Code:

alias flood {
  set %flooder 3
  if (%flooder >= 2) { msg $chan I'M FLOODING! }
  goto 3 {
  }
}
alias unflood {
  unset %flooder
}


Can't figure out the command. It says "Cannot find '3'/'three'"
Back to top Go down
traveler247




Joined : 15 Jul 2008
Posts : 3

PostSubject: Re: Goto command   Tue Jul 15, 2008 8:47 pm

Code:
alias flood {
  set %flooder 3
  :one
  if (%flooder >= 2) { msg $chan I'M FLOODING! }
  goto one
}
alias unflood {
  unset %flooder
}


That should work for you. in your case, all I would know to put is ':3' where I put ':one', and put 3 where I put one. One just makes more logical sense in my opinion. You could do something like donkey, or beer, and it would work as long as you made the destination correctly. Here are more precise instructions, they are from mIRC help. If you want to find the actual location, they are under the alias portion of the help page, which just under mIRC scripts.

The /goto command allows you to jump from one point in a script to another point.



/number {

if ($1 == 1) goto one

elseif ($1 == 2) goto two

else goto unknown

:one

echo One

halt

:two

echo Two

halt

:unknown

echo Unknown number!

halt

}



Using a goto incorrectly could lead to an infinite loop. You can break out of a currently running script by pressing Control+Break.



Note: I didn't prefix the above commands with the / command prefix. This is because the command prefix is really only needed when entering a command on the command line. In scripts, all lines are assumed to start with a command, so you don't need to use the / command prefix.
Back to top Go down

Goto command

View previous topic View next topic Back to top 
Page 1 of 1

Permissions of this forum:You can reply to topics in this forum
ChatScape :: Everything mIRC! :: mIRC Scripting Help Section.-
Post new topic   Reply to topic