Support for bots

By Bielie on Apr 21, 2011

This is a fix i made for a snippet i posted before.

Link to old topic: http://www.hawkee.com/snippet/7680/

This script is used to support your users from distance. The script speaks for it self.

on $*:text:/^[!.](support|help)/:#:{ 
  if (%flood [ $+ [ $nick ] ]) { return }
  set -u3 %flood [ $+ [ $nick ] ] $true
  if (%support1 [ $+ [ $nick ] ]) { notice $nick You still have to wait $duration($var($+(%,support1,$nick),1).secs) before requiring assistance again! | return }
  if (%support2 [ $+ [ $chan ] ]) { notice $nick You already requested assistance! Please wait for a moderator to join the channel. If this is taking too long please join #Staffchannel | return } 
  if ($nick isop #Staffchannel) { notice $nick You are the one that should be helping! | halt }
  if ($chan == #Staffchannel) { notice $nick Ask your question here! This is the supportchannel! | halt }
  if ($acc.num($chan,$nick) <= 1) { notice $nick You dont have enough rights to access this command! | halt }
  else { set -u3600 %support2 [ $+ [ $chan ] ] $true | set -u1800 %support1 [ $+ [ $nick ] ] $true | notice $nick Thanks for your support request we will get to you as soon as possible. If its taking too long please join #staffchannel | msg % $+ #Staffchannel $chan is requiring assistance! Type !accept <channelname> | halt }
}
on $*:text:/^[!.](accept)/:#Staffchannel:{ 
  if (%flood [ $+ [ $nick ] ]) { return }
  set -u3 %flood [ $+ [ $nick ] ] $true
  if ($nick !isop $chan) { notice $nick You dont have enough rights to access this command! | halt }
  if (!$2) { notice $nick Please provide the channel name you want to assist! | halt }
  if (!%support2 [ $+ [ $2 ] ]) { notice $nick That channel isn't requiring assistance at the moment. Please check if $2 is correct! | halt }
  else { msg #Staffchannel $nick is now helping $2 
    if ($nick ison $2) { notice $nick You are now helping $2 with their problem. You are already on the channel! | msg $2 $nick is one of the operators and he is on the channel at the moment. $nick will help this channel now! | halt }
    else { .timer channeltimer 2 msg $2 $nick is going to assist the channel! Please wait.... | halt }
  }
}
alias acc.num {
  if ($1 ischan) {
    if ($2 ison $1) {
      var %pre = $remove($nick($1,$2).pnick,$2)
      ; 0 = Reg; 1 = Voice; 2 = HOp; 3 = Op; 4 = SOp; 5 = Founder
      if ($prop == pre) return %pre
      if ($prop == p) return $left(%pre,1)
      if (~ isin %pre) || ($1 isowner $2) return 5
      elseif (& isin %pre) return 4
      elseif (@ isin %pre) || ($1 isop $2) return 3
      elseif (% isin %pre) || ($1 ishop $2) return 2
      elseif (+ isin %pre) || ($1 isvo $2) return 1
      else return 0
    }
  }
}

on *:JOIN:#:{
  if (%support2 [ $+ [ $chan ] ]) {
    if ($nick isop #staffchannel) { msg # 1,19An operator just joined the channel! Please state your problem! | unset %support2 [ $+ [ $chan ] ] }
  }
}

Comments

Sign in to comment.
Bielie   -  Apr 24, 2011

dont worrie about that ;) Just one thing.

You could try the script before making comments about things that arent working ;)

 Respond  
Jethro   -  Apr 23, 2011

I'm not sure; I find it "dismaying" that it's achievable as per your description. From my experience, when a nickname joins a channel, mIRC has no knowledge about him or her until its internal address list has been updated in a matter of seconds. Once it's updated, mIRC will recognize who's whom. At any rate, pardon me for dragging on your thread in this manner.

 Respond  
Bielie   -  Apr 23, 2011

Some bot named BOT is on a channel named #bot wich is the staff/main channel of it. Someone invites this BOT in their channel #channel. This #channel has a problem. So someone with voice access or higher typs: !support/!help.

If all statements are false the bot's support script(this one) will trigger. It will send a message to #bot, the someone and the #channel. An operator of #bot typs: !accept #channel. The bot will say that is going to support the channel.

The Operator joins the channel and the bot will say that a operator has joined and will help them now.

My Point: The Bot was on both channels allready. Otherwise the whole script wont work. This means that the bot already knows all statements.

Edit: I improved the script a bit aswell. Didnt have time to update it.

 Respond  
Jethro   -  Apr 23, 2011

Perhaps one of us is confused or misunderstood. Please explain it to me so I can think it over.

 Respond  
Bielie   -  Apr 23, 2011

Dont get me wrong but please think this over.

 Respond  
Jethro   -  Apr 22, 2011

I don't know what sort of channel you have, but technically mIRC has no idea who is an OP and who is not when a person joins a channel.

This code below will always return FALSE:

on *:join:#: msg $chan $iif($nick isop $chan,TRUE,FALSE)

In order to detect the correct status, an alias with timer is required:

on *:join:#:.timeropper 1 2 opper $nick $chan
alias -l opper msg $2 I'm $iif($1 isop $2,opped,not opped)
 Respond  
Bielie   -  Apr 22, 2011

You are confusing me.... I deleted your comment indeed. But i completely rewrite this from scratch. And the on join event is for the operators that are joining the channel that was requiring assistance. I tested it and it works fine!

And i actualy respect other people's criticism! I just dont think keeping a comment with cricticism on specific parts of it on a snippet that changed for 90% percent

 Respond  
Jethro   -  Apr 22, 2011

Bielie, you obviously don't respect people's criticism about your snippet. You're supposed to make a reply and accept it, rather than ignore and delete it. This is the purpose of what a social networking site is all about.

That said, I don't believe this is going to work:> on *:JOIN:#:{
if (%support2 [ $+ [ $chan ] ]) {
if ($nick isop #staffchannel) {Upon entry, everybody is seen as a regular user until mIRC IAL is updated.

Again, you can delete this comment after you've seen it. But as a result, you will lose your integrity as a member at Hawkee.

P.S. you should have updated your old snippet instead of submitting a new one.

 Respond  
Bielie   -  Apr 22, 2011

I completely rewrite the script and it should work now :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.