Get Q flags with trigger

Release your script here.
State:
- Author
- What it does
- Perhaps a little guide.
- Also, if the snippet is of any use to the community, it has a chance of getting posted on the main page, so don't hesitate to submit/ask!

Get Q flags with trigger

Postby Cristian » Tue Jan 06, 2009 7:12 am

well a simple botscript, when triggered can find out if its added to a channel service (Q) or not.

Here are some examples.
<Sumsar> .qflags #test
<botnick> I'm not added to Q in #test

<Sumsar> .qflags #sp00fed
<botnick> I'm added to Q in #sp00fed with +ao


If authname is not set, the bot will not tell you what flags it got.

Things to change:
    Authname


I hope you can use it, if you find any bugs error please post them here.

Code: Select all
alias -l db { return qflags.db }
alias -l authname { return Authname }




on *:TEXT:.qflags*:#: {
  if (!$2) {
    .msg $nick Syntax: $1 <#channel>
  }
  else {
    .set %qflags.target $chan
    .write -c $db
    if ($left($2,1) == $chr(35) && $chr(44) !isin $2) {
      .msg Q chanlev $2
    }
  }
}


on *:NOTICE:*:?: {
  if ($nick == Q) {
    .write $db $1-
    if (*You do not have sufficient access on* iswm $1-) || (*End of list.* iswm $1-) {
      checkflag %qflags.target
    }
  }
}
alias checkflag {
  var %x = 0, %z = $lines($db)
  while (%x <= %z) {
    var %line = $read($db,%x)
    if (*You do not have sufficient access on* iswm %line) {
      var %channel = $gettok(%line,8,32)
      var %message = I'm not added to Q in %channel
    }
    elseif (*Known users on* iswm %line) {
      var %c = $gettok(%line,4,32)
      var %channel = $remove(%c,$right(%c,1))
      var %message = I'm added to Q in %channel
    }
    if (*/*/*:* iswm %line) && ($authname == $gettok(%line,1,32)) {
      var %message = %message with $gettok(%line,2,32)
    }
    inc %x
  }
  msg $1 %message
}
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: Get Q flags with trigger

Postby Mirora » Tue Jan 06, 2009 1:20 pm

Looks good. Would be awesome to have something like this in tcl, for my small botservice.


Like:

Mirora: ?checkQ
Hubbot: Checking Qflags for all added channels.
Leaf1: I have no flags in #test1 , #test2
Leaf4: I have no flags in #test9

and such. :)
Mirora
 

Re: Get Q flags with trigger

Postby Cristian » Thu Jan 08, 2009 5:55 pm

Thanks

lets see what the future brings us :)
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: Get Q flags with trigger

Postby Mirora » Thu Jan 08, 2009 6:18 pm

Sumsar wrote:Thanks

lets see what the future brings us :)




Cheers : ))


Hope it will come :)
Mirora
 


Return to Mirc Scripting Release

Who is online

Users browsing this forum: No registered users and 0 guests

cron