mIRC Home    About    Download    Register    News    Help

Print Thread
Working with a channel topic #107576 11/01/05 08:32 AM
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...
Re: Working with a channel topic #107577 11/01/05 10:33 AM
Joined: Mar 2004
Posts: 45
D
Daedalus Offline
Ameglian cow
Offline
Ameglian cow
D
Joined: Mar 2004
Posts: 45
Use $chan(#channel).topic

Re: Working with a channel topic #107578 11/01/05 01:59 PM
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...
Re: Working with a channel topic #107579 11/01/05 02:40 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
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.*