mIRC Home    About    Download    Register    News    Help

Print Thread
#91629 24/07/04 11:00 AM
Joined: Jun 2003
Posts: 92
K
k1ll3rz Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2003
Posts: 92
on *^:Topic:#: {
hadd -m topics $+($cid,:,#,:,$calc($hmatch(topics,$+($cid,:,#,:*),0)+1)) $1-
}

on 1:dialog:channelcentral:init:0: {
did -a channelcentral 43 %topic
}
^----dont show all the topics set while i been in room. how do i get it to show all topics?

on 1:dialog:channelcentral:sclick:34: {
if ($did(43) !== $null) {
.topic %chan1 $did(43).text
}
}
^----------------this werks if topic has sumthing there but how do u get it to reset the topic back to a blank one?

thanx


k1ll3rz
#91630 24/07/04 06:54 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
1. You don't need a hash table for that, write the topics to file and use loadbuf to load it to your dialog (/loadbuf -o dialogname ID topics.txt).

2. /.raw topic #channel :
^ ^ note the trailing colon.

#91631 24/07/04 08:51 PM
Joined: Jun 2003
Posts: 92
K
k1ll3rz Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2003
Posts: 92
i know how to write them to a file but i was wondering how to go about it if all topics are in one file and u want the topics for a certain room only. thanx


k1ll3rz
#91632 24/07/04 10:59 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Something along the lines of this perhaps
Code:
on *:topic:#:{
  ; search topics.txt for CID+:+channelname section (actually for it to NOT be there :))
  if !$read(topics.txt,w,$+([,$cid,:,#,])) {
 
    ; if not found write the "section" name, with the topic on the following line
    write topics.txt $+([,$cid,:,#,],$lf,$1-)
  }
 
  ; if the section was found, then only write the topic data
  else write $+(-il,$calc($readn +1)) topics.txt $1-
}



Code:
on *:dialog:channelcentral:init:0: {
  ; check for the section' pertaining to active channel
  if $read(topics.txt,w,$+([,$cid,:,$active,])) {
    : if found, loadbuf that section using loadbufs -t(opic) switch
    loadbuf $+(-rot,$cid,:,$active) channelcentral 43 topics.txt
  }
}


#91633 24/07/04 11:45 PM
Joined: Jun 2003
Posts: 92
K
k1ll3rz Offline OP
Babel fish
OP Offline
Babel fish
K
Joined: Jun 2003
Posts: 92
thanx. it werks like i wanted to now..... but if i open the channel central in another channel it dont add a spot in the topics.txt file. any idea why. thanx


also when i double-click in another room it dont save the topic already set. any idea why. thanx

Last edited by k1ll3rz; 24/07/04 11:46 PM.

k1ll3rz

Link Copied to Clipboard