mIRC Home    About    Download    Register    News    Help

Print Thread
#122922 17/06/05 11:04 AM
Joined: May 2005
Posts: 4
D
davi Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: May 2005
Posts: 4
hello!

i have tried following script

Code:
 
on 7:text:!queue*:#,?:{
  set %queue $2
}
on 7:text:!news*:#,?:{
  set %news $2
  topic $chan news: %news - queue: %queue
}
 


the problem is that the command !news work fine, but the other command (!queue) doesnt work, can anybody help me?

Last edited by davi; 17/06/05 12:37 PM.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Code:
on 7:text:!queue *:#,?:{
  set %queue $2
  topic $chan news: %news - queue: %queue
}
on 7:text:!news *:#,?:{
  set %news $2-
  topic $chan news: %news - queue: %queue
}


NB : slight changes in !news also (news is likely to have more than one word so $2-, while i assume queues is a number so is just one word $2

Joined: May 2005
Posts: 4
D
davi Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: May 2005
Posts: 4
thats right that $2 is for only one word, but i have test your version with $2- and it doesnt work, he took only the first word:
!news test test1 test2
the topic is set to: news: test and _not_ to test test1 test2

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
thats right that $2 is for only one word, but i have test your version with $2- and it doesnt work, he took only the first word:
!news test test1 test2
the topic is set to: news: test and _not_ to test test1 test2


I have no idea why it did not function correctly for you, Unless it was because you were doing them from PM's, (which i only just noticied you included with the ,?)
When a message is sent in PM there is no $chan value so, any attempt to set the topic would have failed, if this is not the cause then i have no idea as i tested the code just now and from a channel message it worked fine.

However this code well work from both if formated correctly

Code:
;
;Usage in #channel !queue X
;Usage in PM       !queue#channel X
;
on *:text:!queue* *:#,?:{
  var %chan = $iif($chan,$chan,$mid($1,7))
  set %queue $2
  $change.topic(%chan,%news,%queue)
}
;
;Usage in #channel !news X X X
;Usage in PM       !news#channel X X X
;
on *:text:!news* *:#,?:{
  var %chan = $iif($chan,$chan,$mid($1,6))
  set %news $2-
  $change.topic(%chan,%news,%queue)
}
alias -l change.topic { if ($me isop $1) { topic $1 news: $2 - queue: $3 } }


Link Copied to Clipboard