mIRC Home    About    Download    Register    News    Help

Print Thread
#98529 24/09/04 12:57 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Hi.. I was wonderring how to make a script on a bot that locks the topic

eg. If i have users in my remote with $ulevel 11 and a user without level 11 chages topic then the bot will change it back to the old topic... How do i make a script like that?? confused

#98530 24/09/04 02:51 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Code:
on me:*:join:[color:red]#[/color]: set %topic. [ $+ [ $chan ] ] $chan(#).topic
on @*:topic:[color:red]#[/color]: {
 if (%topic. [ $+ [ $chan ] ]) {
  if ($ulevel != 11) { topic $chan %topic. [ $+ [ $chan ] ] }
  else { set %topic. [ $+ [ $chan ] ] $1- }
 }
}
You first need to save the old topic, that's why the On Join is there. If a non-11 changes the topic, it sets the old one back. If a lvl 11does the change, then it resets the topic lock.

You can change the # to the channel(s) you want.

Hope this helps smile
Zyzzyx.

#98531 24/09/04 05:47 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Okay and will it save the new one when the $ulevel 11 changes it?

#98532 24/09/04 06:29 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Yes, the else { set %topic. [ $+ [ $chan ] ] $1- } should do it. smile

#98533 24/09/04 08:50 PM
Joined: Dec 2002
Posts: 143
G
Vogon poet
Offline
Vogon poet
G
Joined: Dec 2002
Posts: 143
This will save the topic on join, save a topic from user level 11 and refuse a topic from users of other levels. If there is no valid topic, this will erase a non valid one. It clears the variable on part and quit.


Code:
on me:*:join:#: set $+(%,topic_,$chan) $chan(#).topic
on @+11:topic:#: set $+(%,topic_,$chan) $chan(#).topic
on @!*:topic:#: {
  if ($len($eval($+(%,topic_,$chan ),2)) == 0) {
    echo $chan $chr(160)
    echo 04 -t $chan *** NO VALID TOPIC SET
    echo $chan $chr(160)
    topic $chan $chr(160)
  }
  else topic $chan $eval($+(%,topic_,$chan ),2)
}
on *:part:#: unset $+(%,topic_,$chan)
on *:quit: unset %topic_*  

#98534 25/09/04 01:47 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Okay... Thanks alot for your help both of you smile hope to see you on mirc sometime...


BTW you forgot
Code:
on *:part:#:{
   [color:red] if ($nick == $me) {  [/color]
    unset $+(%,topic_,$chan)
  }
}

on *:quit:{
   [color:red] if ($nick == $me) {  [/color]
    unset %topic_* 
  }
}

#98535 25/09/04 02:27 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Oh one thing more... This part doenst work

Code:
 on me:*:join:#: set $+(%,topic_,$chan) $chan(#).topic 


It doenst save the topic thats on when it joins confused

#98536 25/09/04 02:45 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Code:
raw 366:*: set $+(%,topic,.,$chan) $chan($2).topic
on @*:topic:#: {
 if (%topic. [ $+ [ $chan ] ]) {
  if ($ulevel != 11) { topic $chan %topic. [ $+ [ $chan ] ] }
  else { set %topic. [ $+ [ $chan ] ] $1- }
 }
}
This should do it smile

#98537 25/09/04 02:52 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
I'm sorry Zyzzyx26 but i dont quite understad that crazy

#98538 25/09/04 02:59 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
The raw 366 is the end of the /names command, which is performed everytime you join a channel. $2, in the case, is the channel name. I don't know why that on me:*: join did not work, but the raw one will (unless you've previously halted it).

BTW, the correct raw line is: raw 366:*: set $+(%,topic,.,$2) $chan($2).topic

Zyzzyx smile

#98539 25/09/04 03:12 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
Great... Hmm you are damn good at this.. There is only one problem now... Your script keeps looping... If a user that is not level 11 changes topic the bot changes back and keeps doing it... It spams!

#98540 25/09/04 03:15 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
Code:
raw 366:*: set $+(%,topic,.,$2) $chan($2).topic
on @[color:Red]![/color]*:topic:#: {
 if (%topic. [ $+ [ $chan ] ]) {
  if ($ulevel != 11) { topic $chan %topic. [ $+ [ $chan ] ] }
  else { set %topic. [ $+ [ $chan ] ] $1- }
 }
}
Sorry, my bad smirk The red ! should take care of it. It doesn't activate the script if the one running the code has triggered it.

Have fun smile
Zyzzyx.

Last edited by Zyzzyx26; 25/09/04 03:16 PM.
#98541 25/09/04 03:20 PM
Joined: May 2004
Posts: 132
N
NoPleX Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: May 2004
Posts: 132
okay thanks... I also fixed the other one:
Code:
 raw 366:*: set $+(%,topic,.,$2) $chan($2).topic

on @+11:topic:#:{
  set $+(%,topic,.,$chan) $chan(#).topic
}

on @!*:topic:#: {
  if ($len($eval($+(%,topic,.,$chan ),2)) == 0) {
    echo $chan $chr(160)
    echo 04 -t $chan *** NO VALID TOPIC SET
    echo $chan $chr(160)
    topic $chan $chr(160)
  }
  else topic $chan $eval($+(%,topic,.,$chan ),2)
}

on me:*:part:#:{
  unset $+(%,topic,.,$chan)
}

on me:*:quit:{
  unset %topic,.*  
}
 


Link Copied to Clipboard