mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2004
Posts: 40
D
dmmrs Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2004
Posts: 40
One more question smile

Ive got a script that works with the channel topic, basically if soemone types something like:

!addwebsite xxxxxxxx

Then it appends xxxxxxx (NICKNAME) to the topic. However, when the topic is full, it won't append anything, obviously. How do i get my script to see if the topic is full first, then if it is, it auto makes enough space by deleting word(s) at the start of the topic?

Any help appreciated.


i script, therefore i am smirk
theres logic in there somewhere...
Joined: Mar 2004
Posts: 45
D
Ameglian cow
Offline
Ameglian cow
D
Joined: Mar 2004
Posts: 45
Use $chan(#channel).topic

Joined: Jul 2004
Posts: 40
D
dmmrs Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2004
Posts: 40
That is what I am using, however, i need a way for it to see if the topic is full already, and if so, then to delete say the first 2 or specified words smile


i script, therefore i am smirk
theres logic in there somewhere...
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
You need first to save the maximum topic length (from raw 005) when you connect, then check $len of topic against that value .
Code:
raw $005:/TOPICLEN=(\d+)/:set %topiclen. $+ $cid $regml(1)
on @*:text:!addwebsite &:#:{
  tokenize 32 $chan(#).topic $2 ( $+ $nick $+ )
  while %topiclen. [ $+ [ $cid ] ] < $len($1-) { tokenize 32 $3- }
  topic # $1-
}
on *:start:unset %topiclen.*


Link Copied to Clipboard