mIRC Home    About    Download    Register    News    Help

Print Thread
#246007 18/05/14 12:40 AM
Joined: Apr 2014
Posts: 19
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Apr 2014
Posts: 19
currently i have
Code:
on *:text:!editme*:#: {
  if ( $regex($2-, \.com) ) { msg $chan $nick --> Communicate THIS! (No links allowed in !whoisuser message) }
  if ( $regex($2-, \.co) ) { msg $chan $nick --> Who uses .co anymore? Kappa (No links allowed in !whoisuser message) }
  if ( $regex($2-, \.net) ) { msg $chan $nick --> Net of webs! NOPE. (No links allowed in !whoisuser message) }
  if ( $regex($2-, \.org) ) { msg $chan $nick --> Orginizaation of MY ASS! (No links allowed in !whoisuser message) }
  if ( $regex($2-, \.de) ) { msg  $chan $nick --> what is that, german? (No links allowed in !whoisuser message) }
  if ( $regex($2-,\/join) ) { msg $chan $nick --> Im will not join any channel but RNG's and dudes! }
  else { .writeini users.ini $nick Message $2-}
}

I was wondering if i could do something so on the ELSE when it does .writeini it could also say a message so that the user knows it's been edited?

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Code:
  else { msg # Message goes here | .writeini users.ini $nick Message $2- }


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2014
Posts: 19
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Apr 2014
Posts: 19
Thank you once again

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Just a note: Your write line will still trigger on any event apart from the last one since you're not using elseifs properly.
Change all if apart from the first one to elseif otherwise the script will always write to the ini file even when another line triggered. Since you didn't specify it to halt.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2014
Posts: 19
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Apr 2014
Posts: 19
Originally Posted By: Nillen
Just a note: Your write line will still trigger on any event apart from the last one since you're not using elseifs properly.
Change all if apart from the first one to elseif otherwise the script will always write to the ini file even when another line triggered. Since you didn't specify it to halt.


didn't see this message sooner, came up with my own method:
Code:
on *:text:!editme*:#: {
  var %allowed
  %allowed = true
  if ( $regex($2-, \.com) ) { msg $chan $nick --> Communicate THIS! (No links allowed in !whoisuser message) | %allowed = false }
  if ( $regex($2-, \.net) ) { msg $chan $nick --> Net of webs! NOPE. (No links allowed in !whoisuser message) | %allowed = false }
  if ( $regex($2-, \.org) ) { msg $chan $nick --> Orginizaation of MY ASS! (No links allowed in !whoisuser message) | %allowed = false }
  if ( $regex($2-, \.de) ) { msg  $chan $nick --> What is that, German? (No links allowed in !whoisuser message) | %allowed = false }
  if ( $regex($2-, \.fr) ) { msg $chan $nick --> Au revoir, Mademoiselle Link! (No links allowed in !whoisuser message) | %allowed = false }
  if ( $regex($2-,\/join) ) { msg $chan $nick --> Im will not join any channel but RNG's and dudes! | %allowed = false }
  if ( $regex($2-,\.color) ) { msg $chan $nick --> Nice try, but I will always be the colour firebrick\! | %allowed = false }
  if ( $regex($2-,\/mod) ) { msg $chan $nick --> You\! Shall\! Not\! Mod\! Nice try sir\/madam\. | %allowed = false }
  if ( $regex($2-,\/unmod) ) { msg $chan $nick --> Unmoding\? Nice try\. Mods are mods for a reason, and they'll stay that way until further notice\. | %allowed = false }
  else { if ( %allowed == true) { msg $chan $nick --> Your \!whoisuser has been edited to: $2- | .writeini users.ini $nick Message $2- } }
}

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
That's still bad. Just use elseif properly.

If I were to type "x .com.net.org.de.fr/join.color/mod/unmod" you would message the channel 9 times.


Link Copied to Clipboard