mIRC Home    About    Download    Register    News    Help

Print Thread
B
Billl
Billl
B
Code:
on *:TEXT:.target:#team-tt:{
  msg # The current target for Team-TT is, %target $+ .
}
on *:TEXT:.settarget*:#team-tt:{
  if ($nick == Bill) set %target $2- | msg $chan Target changed to " $+ %target $+ " $+ , you may now want to set the channel topic.
else msg $chan you're not Bill.
}

Last edited by Billl; 21/04/09 02:52 PM.
5
5618
5618
5
What is and what is not happening? Do you see the .target and/or the .settarget message? Is %target set? Does the 'else' statement work? Specifics please.

Joined: Jul 2006
Posts: 4,034
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,034
You're code is wrong because you're not using { } after the if ($nick == Bill), so only the /set command is related to the if, the rest is executed in order so the else follow the /msg, this is not possible, try :
Code:
on *:TEXT:.target:#team-tt:{
  msg # The current target for Team-TT is, %target $+ .
}
on *:TEXT:.settarget*:#team-tt:{
  if ($nick == Bill) { set %target $2- | msg $chan Target changed to " $+ %target $+ " $+ , you may now want to set the channel topic. }
else msg $chan you're not Bill.
}



#mircscripting @ irc.swiftirc.net == the best mIRC help channel
B
Billl
Billl
B
.target is the command used by me, the script is to be put on the bot.

This is what happens..

[16:10] <&Bill> .settarget test10
[16:10] <@Tyson> Target changed to "test10", you may now want to set the channel topic.
[16:10] * Bill is now known as asd
[16:10] <&asd> .settarget fsdfs
[16:10] <@Tyson> Target changed to "test10", you may now want to set the channel topic

When I have the nick other than "Bill" the variable doesn't get set, but the message still gets sent to the channel showing the current variable, instead of this I just want the message "You're not Bill" to be sent to the channel.

B
Billl
Billl
B
Ah thank you Wims, I understand now.

Thanks guys.


Link Copied to Clipboard