mIRC Home    About    Download    Register    News    Help

Print Thread
#109796 01/02/05 11:20 AM
Joined: Feb 2005
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Feb 2005
Posts: 4
Hey There, Im a Nub with irc i was wondering if theres a script that you can get so possibly when some1 types !admin or !help it pm's an op and also so when the admin/ ops types !next it shows in order who needs help, if you could help me out thatd be great, cheers

#109797 01/02/05 06:50 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Begin by typing /set %h_chan YOUR_CHANNEL in any window of mIRC.

Then put this code in your remotes (ALT-R). Edit the SOME_OP_NICKNAME in the first 3 lines to be a bunch of ops nicknames who should be notified by the bot. it should be in the form

NICK1 NICK2 NICK3 NICK4 etc..

Code:
alias -l h_opnick {
  return SOME_OP_NICKNAME
}

ON $*:TEXT:/^!(?:admin|help)(?:\s|$)/:%h_chan {
  var %i = 1, %reason = Reason: $iif($2-, $2-, N/A)
  .write $+(-s,$nick) h_queue.txt $nick Time: $time %reason
  while ($gettok($h_opnick,%i,32)) {
    if ($v1 isop #) {
      .msg $v1 $nick needs help. %reason
    }
    inc %i
  }
}

ON *:TEXT:!next:?:if ($nick isop %h_chan) { .msg $nick Help Queue List: | .play -q3 $nick h_queue.txt }
ON *:TEXT:!remove *:?:if ($nick isop %h_chan) { .write $+(-ds,$2) h_queue.txt | .msg $nick Removed $2 from Help Queue List. }


Keep in mind that !next and !remove must be messaged privately to the bot, where !admin and !help are done in the channel.

!remove will remove the person from the help queue, you type !remove NICKNAME to use it


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
#109798 01/02/05 10:10 PM
Joined: Feb 2005
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Feb 2005
Posts: 4
Hi there, thanks for your help its playing back the list after i added the text file but its not pming the ops or adding the user to the que, only way is if i add it manually

Code:
alias -l h_opnick {
  return admin1 admin2
}

ON $*:TEXT:/^!(?:admin|help)(?:\s|$)/:%h_chan {
  var %i = 1, %reason = Reason: $iif($2-, $2-, N/A)
  .write $+(-s,$nick) h_queue.txt $nick Time: $time %reason
  while ($gettok($h_opnick,%i,32)) {
    if ($v1 isop #) {
      .msg $v1 $nick needs help. %reason
    }
    inc %i
  }
}

ON *:TEXT:!next:?:if ($nick isop %h_chan) { .msg $nick Help Queue List: | .play -q3 $nick h_queue.txt }
ON *:TEXT:!remove *:?:if ($nick isop %h_chan) { .write $+(-ds,$2) h_queue.txt | .msg $nick Removed $2 from Help Queue List. }
  


an yes i did activate it :P

#109799 01/02/05 10:17 PM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
He missed a ':', and the :'s in the matchtext part of the event won't work because : means something in an event, try this:

Code:
ON *:TEXT:*:%h_chan[color:red]:[/color]{
  [color:red]if ($regex($1-,/^!(?:admin|help)(?:\s|$)/)) {[/color]
    var %i = 1, %reason = Reason: $iif($2-, $2-, N/A)
    write $+(-s,$nick) h_queue.txt $nick Time: $time %reason
    while ($gettok($h_opnick,%i,32)) {
      if ($v1 isop #) { .msg $v1 $nick needs help. %reason }
      inc %i
    }
  [color:red]}[/color]
}

#109800 01/02/05 10:43 PM
Joined: Feb 2005
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Feb 2005
Posts: 4
cheers for yourhelp would it be possible rather than msging the bot if an op says !next , and then in open channel in announces whos next for support.

#109801 01/02/05 10:53 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
cheers for yourhelp would it be possible rather than msging the bot if an op says !next , and then in open channel in announces whos next for support.


try out...

ON *:TEXT:!next:%h_chan:if ($nick isop %h_chan) { .msg %h_chan Next in the Help Queue List: | .play -q3 l1 %h_chan h_queue.txt }
ON *:TEXT:!remove *:%h-chan:if ($nick isop %h_chan) { .write $+(-ds,$2) h_queue.txt | .msg %h_chan Removed $2 from Help Queue List. }

#109802 01/02/05 11:11 PM
Joined: Feb 2005
Posts: 4
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Feb 2005
Posts: 4
that didnt do anything when i typed !next in the channel smirk

#109803 01/02/05 11:20 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
on TEXT events don't trigger on yourself, you must have someone else type !next or load up a clone and test it with that.


Gone.
#109804 02/02/05 03:39 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
As FiberOptics said you cant trip a ON TEXT event yourself, so heres a fix for ya...

Code:
alias -l text.event.next { if ($1 isop %h_chan) { .msg %h_chan Next in the Help Queue List: | .play -q3 l1 %h_chan h_queue.txt } }
alias -l text.event.!remove { if ($1 isop %h_chan) { .write $+(-ds,$2) h_queue.txt | .msg %h_chan Removed $2 from Help Queue List. } }
;
ON *:TEXT:!next:%h_chan:{ text.event.next $nick $2- }
ON *:TEXT:!remove *:%h-chan:{ text.event.remove $nick $2- }
ON *:INPUT:%h_chan:{
  if ($1 == !next) { text.event.next $me $2- }
  elseif ($1 == !remove) { text.event.remove $me $2- }
}


Link Copied to Clipboard