Using "If" in a script file

Posted by Penguin on Sat 27 Jul 2002 03:51 AM — 5 posts, 18,807 views.

#0
Hi,
is it possible to send different stuff to the world if a certain variable is of a certain value?
Like for example if my script is:

Sub Kill_duck (AliasName, TriggerLine, arrWildcards)
world.send "kill & _
world.getvariable ("duck")
End Sub

However can I get it to send a different thing if my variable "duck" is set to a particular value like "chicken"?
How then would I get it to work?
#1
Sub Kill_duck (AliasName, TriggerLine, arrWildcards)
if world.getvariable ("duck") = "chicken"
world.send "seduce & _
world.getvariable ("duck")
end if
world.send "kill & _
world.getvariable ("duck")
End Sub

I am using this script currently, however if "duck" is "chicken", it will send "seduce chicken" then "kill chicken" as well.
#2
Oops.. okay I managed to get it right by looking at another post in the forum. Thanks anyway:)
PS: Maybe a poster can be allowed to remove his own posts so as not to display his ignorance:P *grin*
Australia Forum Administrator #3
A poster can delete his/her own posts.
#4
Glad to see I just showed how high my intelligence level is again:)