Top

Help System For Bot


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  4.0 (of 2 scores)
Date Added  May 29, 2008
Last Updated  Jul 03, 2008
Tags  bot  help  query 

Introduction

Hi all
First of all thanks to RusselB and xDaeMoN for all your help: http://www.hawkee.com/phpBB2/viewtopic.php?t=17395 , without you i wasn't able to write this snippets, and sorry for the bad English, the snippets need to be spellchecked, i'll update it soon. I've also triyed to remove all the reference to my chan tryng to not spam Hawkee.

Here it is the function:

[10:44:25] <essebi> !helptrigger
[10:44:26] <m00gle> This is an automated system for searching user by query, here is the triggers:
[10:44:27] <m00gle>
[10:44:27] <m00gle> [ADMINS]
[10:44:28] <m00gle> !AddHelper *Nick* - For adding a Member to the Help Team [query]
[10:44:28] <m00gle> !RemoveHelper *Nick* - For Removing a Member from the Help Team [query]
[10:44:29] <m00gle> !AddAdmin *Nick* - For adding a Member to the Admins List [query]
[10:44:29] <m00gle> !RemoveAdmin *Nick* - For Removing a Member from the Admins List [query]
[10:44:31] <m00gle> !Reply *message* - For reply to the user that call your attention [query]
[10:44:33] <m00gle>
[10:44:36] <m00gle> [HELP TEAM]
[10:44:38] <m00gle> !GiveHelp - For give help to the user that call your attention [query]
[10:44:40] <m00gle> !Admin *message* - For call an Admin [query]
[10:44:42] <m00gle>
[10:44:46] <m00gle> [USERS]
[10:44:50] <m00gle> !Assist *Message* - For call a Member of the Help Team [chan]

Grab the Code

;#######################################
;#######################################
;##                                   ##
;##      Help System For Bot          ##
;##        Writed by essebi           ##
;##   Thanks to RusselB and xDaeMoN   ##
;##                                   ##
;##  Load it On the Remote and type   ##
;##       !helptrigger on Query       ##
;##                                   ##
;#######################################
;#######################################
 
;-------------------- EVENTS  -------------------------------
on *:join:#:{
  if $read($mircdir $+ skyhelp.txt,wnt,$address($nick,2)) {
    set %helpteam $addtok(%helpteam,$nick,44)
  }
  if $read($mircdir $+ skyadmin.txt,wnt,$address($nick,2)) {
    set %adminteam $addtok(%adminteam,$nick,44)
  }
}
on *:nick:{
  if $read($mircdir $+ skyhelp.txt,wnt,$address($newnick,2)) {
    set %helpteam $addtok(%helpteam,$newnick,44)
    set %helpteam $remtok(%helpteam,$nick,1,44)
  }
  if $read($mircdir $+ skyadmin.txt,wnt,$address($newnick,2)) {
    set %adminteam $addtok(%adminteam,$newnick,44)
    set %adminteam $remtok(%adminteam,$nick,1,44)
  }
}
on *:part:#:{
  set %helpteam $remtok(%helpteam,$nick,1,44)
  set %adminteam $remtok(%adminteam,$nick,1,44)
}
on *:quit:{
  set %helpteam $remtok(%helpteam,$nick,1,44)
  set %adminteam $remtok(%adminteam,$nick,1,44)
}
on *:kick:#:{
  set %helpteam $remtok(%helpteam,$knick,1,44)
  set %adminteam $remtok(%adminteam,$knick,1,44)
}
;-------------------- HELP TEAM TRIGGERS  -------------------------------
on 90:TEXT:!addhelper *:?: {
  if ($address($2,2) == $null) { .msg $nick Sorry $nick i cant find $2 : you put a wrong nick or $2 isn't at least peon }
  elseif $read($mircdir $+ skyhelp.txt,wnt,$address($2,2))  { .msg $nick $2 is just on my database }
  else {
    .write $mircdir $+ skyhelp.txt $address($2,2)
    .msg $nick User $2 is succesfully added to the Help Team
    .msg $2 You're now added to the Help Team
  }
}
on 90:TEXT:!removehelper *:?: {
  if ($address($2,2) == $null) { .msg $nick Sorry $nick i cant find $2 : you put a wrong nick or $2 isn't at least peon }
  elseif $read($mircdir $+ skyhelp.txt,wnt,$address($2,2)) {
    var %a = $address($2,2)
    var %b = $read($mircdir $+ skyhelp.txt,w,$+(*,%a,*))
    var %c = $readn
    var %d = $remove(%b,%a)
    write -l $+ %c $mircdir $+ skyhelp.txt %d
    .msg $nick User $2 is succesfully removed from the Help Team
  }
  else .msg $nick sorry but seems $2 isn't on my database
}
on *:text:!assist*:#:{
  if $($+(%,help),2) == 1 { .msg $chan Sorry $nick you need to wait, there's another request pending }
  else {
    set %help.chan $chan
    set %help.nick $nick
    set -u120  %help 1
    .msg $chan $nick your request has been sent to the Help Team
    .msg %helpteam $nick need help: $2-
    .timerhelp 1 120 msg $chan Sorry $nick I can't find no one that can help you on this moment
  }
}
on *:TEXT:!givehelp:?:{
  if ($nick !isin %helpteam) { .msg $nick you arent part of the help team }
  elseif $($+(%,help),2) == $null { .msg $nick There's no help request pending, last one was taken by $($+(%,help.,last),2) }
  else {
    set %help.Last $nick
    msg $($+(%,help.,chan),2) $nick will help you soon, wait here his reply
    .timerhelp off
    unset %help.nick %help.chan %help
  }
}
;-------------------- ADMINS TEAM TRIGGERS  -------------------------------
on 90:TEXT:!addadmin *:?: {
  if ($address($2,2) == $null) { .msg $nick Sorry $nick i cant find $2 : you put a wrong nick or $2 isn't at least peon }
  elseif $read($mircdir $+ skyadmin.txt,wnt,$address($2,2))  { .msg $nick $2 is just on my database }
  else {
    .write $mircdir $+ skyadmin.txt $address($2,2)
    .msg $nick User $2 is succesfully added to the Admins
    .msg $2 You're now added to the Admins
  }
}
on 90:TEXT:!removeadmin *:?: {
  if ($address($2,2) == $null) { .msg $nick Sorry $nick i cant find $2 : you put a wrong nick or $2 isn't at least peon }
  elseif $read($mircdir $+ skyadmin.txt,wnt,$address($2,2)) {
    var %a = $address($2,2)
    var %b = $read($mircdir $+ skyadmin.txt,w,$+(*,%a,*))
    var %c = $readn
    var %d = $remove(%b,%a)
    write -l $+ %c $mircdir $+ skyadmin.txt %d
    .msg $nick User $2 is succesfully removed from the Admins
  }
  else .msg $nick sorry but seems $2 isn't on my database
}
on *:text:!admin*:?:{
  if ($nick !isin %helpteam) { .msg $nick you arent part of the help team, you can't call admins }
  elseif $($+(%,help.admin),2) == 1 { .msg $nick Sorry $nick you need to wait, there's another request pending }
  else {
    set %help.admin.nick $nick
    set -u300  %help.admin 1
    .msg $nick your request has been sent to the Admins
    .msg %adminteam $nick need help: $2-
    .timeradmin 1 300 msg $nick Sorry $nick I can't find no one that can help you on this moment
  }
}
on *:TEXT:!reply *:?:{
  if ($nick !isin %adminteam) { .msg $nick you arent part of the Admin Team }
  elseif $($+(%,help.admin),2) == $null { .msg $nick There's no help request pending, last one was taken by $($+(%,help.,last),2) }
  else {
    msg $($+(%,help.,admin.,nick),2) Here is the reply from $nick : $2-
    .timeradmin off
    unset %help.admin %help.admin.nick
  }
  else .msg $nick There's no help request pending
}
;--------------------------------- HELP -------------------------------------
On 30:TEXT:!helptrigger:?:{
  .timer 1 1 .msg $nick This is an automated system for searching user by query, here is the triggers:
  .timer 1 2 .msg $nick 
  .timer 1 2 .msg $nick [ADMINS]
  .timer 1 3 .msg $nick !AddHelper *Nick*     - For adding a Member to the Help Team         [query]
  .timer 1 3 .msg $nick !RemoveHelper *Nick*  - For Removing a Member from the Help Team     [query]
  .timer 1 4 .msg $nick !AddAdmin *Nick*      - For adding a Member to the Admins List       [query]
  .timer 1 4 .msg $nick !RemoveAdmin *Nick*   - For Removing a Member from the Admins List   [query]
  .timer 1 5 .msg $nick !Reply *message*      - For reply to the user that call your attention        [query]
  .timer 1 5 .msg $nick 
  .timer 1 6 .msg $nick [HELP TEAM]
  .timer 1 6 .msg $nick !GiveHelp             - For give help to the user that call your attention    [query]
  .timer 1 7 .msg $nick !Admin *message*      - For call an Admin                                     [query]
  .timer 1 7 .msg $nick 
  .timer 1 8 .msg $nick [USERS]
  .timer 1 8 .msg $nick !Assist *Message*     - For call a Member of the Help Team           [chan]
}
 

Comments

  (4)  RSS
Yilena
Comments: 13
 
mIRC Snippet:  Help System For Bot
Posted on Jul 3, 2008 6:18 am
the script aint working for me..

i pasted it in remotes. gave user levers.. but it wont even respond to !helptrigger

:$

Help? $:
essebi
Comments: 5
 
mIRC Snippet:  Help System For Bot
Posted on Jul 3, 2008 6:53 am
The people you add on it need to hop (part/join) the channel after he's added, check the variable %helpteam if there's the right nickname on it.
Also you need to check where the .txt file is created, i actually store it in
Code:
 C:\mirc\abook2\skyhelp.txt
, you can change it in
Code:
$mircdir $+ skyhelp.txt

You need to edit for use with your pourpose, or if you aren't able you can contact me and i can do it for you.

Cheers
essebi
Typo
Comments: 228
 
mIRC Snippet:  Help System For Bot
Posted on Jul 3, 2008 7:41 am
Essebi, you may want to consider adding an on load section to let the user set the paths on install because you have two different paths in your script that we can be sure almost nobody else will have. Or you could do like I do and try to work with your files staying in the $mircdir or better yet $scriptdir.

Either way this cannot be considered usable as-is so if I were to rate it now it wouldnt be very high at all.

Just a suggestion tho.
essebi
Comments: 5
 
mIRC Snippet:  Help System For Bot
Posted on Jul 3, 2008 10:00 am
Thanks for your suggestion, that was one of my first scripts and i didn't consider it until yilena told me that don't work.
Now i've edited it just to make it usable on every client.
Nothing to add, my bad :)

essebi

Commenting Options

Register or Login to Hawkee.com or login with your Facebook account by clicking the button below.

Bottom