Page 1 of 1

Check for flags on Q

PostPosted: Sun Dec 14, 2008 7:25 pm
by Przemo
Well Hi,
I'd like to have have script that would check for flags on Q but I dunno how to write it :<
Script is actually needed to compile it with request script, if Bot stil will not have flags on Q in like 10 mins or smth will leave channel.
If somebody would script it I'd be really pleased :>
Greets, Przemo :)

Re: Check for flags on Q

PostPosted: Thu Dec 18, 2008 5:17 pm
by StareX
for the script of chanlev
you need to write
!Qnet nick +/-flags

and for check who is in the chanlev type only !Qnet
and for chanflags and chanmodes too:
for the chanmode you type !chanmode mode
for the chanflags you type: !chanflags +/-modes
here ya go:

Code: Select all
on *:input:#:{ 
if ($1 == !Qnet) { msg Q chanlev # $2 $3 }
if ($1 == !chanmode) { msg Q chanmode # $2 $3 }
if ($1 == !chanflags) { msg Q chanflags # $2 }


have fun! ;)
I hope thats what you wanted.

Re: Check for flags on Q

PostPosted: Sat Dec 20, 2008 11:36 pm
by Przemo
lol starex, I didn't mean this think You have posted, I mean script that wil check if Bot that got requested to #somechan already got flags on Q, and it should be checked like 3 times in 9 mins (so after 3 mins first check, another 3 mins 2nd check and another check after total o 9 mins, if still no flags bot leaves #somechan) I hope You get me now :P

Re: Check for flags on Q

PostPosted: Sun Dec 21, 2008 10:28 pm
by Cristian
This script starts to check for flags on join.

You are allowed to have X strikes (changeable), when checking for flags and you get 'no access', a message is sent to the development channel
You can set a channel of your choice, where the information about the strikes should go.

After the strikes, a final message is sent, and the bot will part the channel, it will not send any messages to the channels its on, only the development channel, if you wish it should do that, you have to edit the script.

I hope this is what you are looking for.

If you have any problems, please post them here.

Code: Select all
alias -l inifile { return file.ini }
alias -l developmentchannel { return #development_channel }
alias -l totalstrike { return 3 }

raw 366:& & *: {
  .checktimer $2
}
alias checktimer {
  if ($readini($inifile,react,$1) == $totalstrike) {
    if ($me ison $1) {
      echo -st .part $1
    }
    $+(.timer(checkflag.,$1)) off
    .remini $inifile react

    msg $developmentchannel Strike out on $+($chr(2),$1,$chr(2)) - I'm parting the channel.

    return
  }

  if (!$timer(checkflag. [ $+ [ $1 ] ])) {
    $+(.timer.checkflag.,$1) 1 300 checktimer $1
    .msg Q chanlev $1
  }
}
on *:NOTICE:*:?: {
  if ($nick == Q) {
    if (*You do not have sufficient access on* iswm $1-) {
      .writeini $inifile react $8 $calc($readini($inifile,react,$8)+1)
      msg $developmentchannel I have no flags on $+($chr(2),$8,$chr(2)) Strike: $+($chr(2),$readini($inifile,react,$8),$chr(2),/,$chr(2),$totalstrike,$chr(2))
    }
  }
}

Re: Check for flags on Q

PostPosted: Sun Dec 21, 2008 10:36 pm
by Przemo
Yeah, it is what I wanted, but still I don't get what for is $inifile :P

Re: Check for flags on Q

PostPosted: Sun Dec 21, 2008 10:43 pm
by Cristian
Its a file(alias) I'm using to store the channel and the reaction levels, it might done in another way, but thats how I did it.

Code: Select all
alias -l inifile { return file.ini }

-l means local, it can only be triggered from inside the script.

Re: Check for flags on Q

PostPosted: Sun Dec 21, 2008 10:47 pm
by Przemo
Yeah, really nice script :)

Thank You much dude :D I know everything and gonna mod it a bit :P