mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Riamus2 #221160 09/05/10 12:10 AM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Right my mistake. I thought venus78 asked that as a separate matter.

Tomao #221201 10/05/10 11:48 AM
Joined: Mar 2010
Posts: 17
V
Venus78 Offline OP
Pikka bird
OP Offline
Pikka bird
V
Joined: Mar 2010
Posts: 17
claim down dun fight sorry i'm newbie n thanks all for helpping me out and thanks for consern

Venus78 #221202 10/05/10 11:50 AM
Joined: Mar 2010
Posts: 17
V
Venus78 Offline OP
Pikka bird
OP Offline
Pikka bird
V
Joined: Mar 2010
Posts: 17
ok need the last help anyone have code for idle kicked in room #help,if the user idle more then 7 minute will kick them out

Venus78 #221205 10/05/10 01:09 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
(untested scribble)
Code:
; start offline timer to trigger "removeidlers"-alias every 30s
on *:start: .timerremoveidlers 0 30 removeidlers
on *:unload: .timerremoveidlers off

alias removeidlers {

  ; ######## SETUP START ########
  ; channels (separated by comma) 
  var %chans = #help,#anotherchannel
  ; max. idle duration (in seconds) 
  var %limit = 420
  ; kick delay (in milliseconds) 
  var %delay = 500
  ; ######## SETUP END ########

  ; create a clean temp file
  var %f = removeidlers.txt
  write -c $qt(%f)
  ; loop channels
  var %c = 1
  while ($gettok(%chans,%c,44)) {
    ; able to kick
    if ($me isop $v1) {
      ; loop users of that chan
      var %chan = $v2, %n = 1
      while ($nick(%chan,%n,r)) {
        var %nick = $v1
        ; if idle of that user exceeds idle limit: write kick command to temp file
        if ($nick(%chan,$v1).idle > %limit) { write $qt(%f) kick %chan %nick Please don't idle in %chan }
        inc %n
      }
    }
    inc %c
  }
  ; any lines in temp file
  if ($lines(%f)) { 
    ; play commands with specified delay to status window and remove tempfile
    .play -pcs $qt(%f) %delay 
    .remove $qt(%f)
  }
}
Note that it's set to kick "regular" idle users only

Last edited by Horstl; 10/05/10 01:16 PM.
Horstl #221900 31/05/10 01:36 PM
Joined: Mar 2010
Posts: 17
V
Venus78 Offline OP
Pikka bird
OP Offline
Pikka bird
V
Joined: Mar 2010
Posts: 17
[code][/code]
on *:TEXT:*:#: {
if (% $+ k == $strip($1-)) {
.raw kick # $nick Auto-kick for do to smart 4 kick number %kickss ) | mode # +b $mask($fulladdress,13) | .timer 1 120 mode # -b $mask($fulladdress,13)
return
}
if (% $+ c == $strip($1-)) {
set % $+ c
}
elseif (% $+ u == $strip($1-)) {
set % $+ u
}
else {
set % $+ f
timer 1 12 /unset % $+ $nick
}
}

can help me by this,when ppl typing like this got kick

f
u
c
k

Venus78 #221902 31/05/10 02:23 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
You're comparing the message to variable names for a literal match, and you unset some variable %NICK that never had been set... Try this:
Code:
; text event triggering if you're op in that channel and stripped message is a single letter (A-z)
on $@*:text:/^[a-z]$/Si:#: {
  ; "item" = <server connection ID>.<channel name>.<nick>
  var %i = $+($cid,.,$chan,.,$nick)
  ; increase value of "item" in hash table "letterspam" (item auto-unsets after 30 seconds)
  hinc -mu30 letterspam %i 

  ; value of "item" is above 3 (4 or more letters had been spammed)
  if ($hget(letterspam,%i) > 3) {
    ; remove "item" from hash table "letterspam"
    hdel letterspam %i

    ; YOUR ACTION GOES HERE
    kick $chan $nick Don't spam single letters!

  }
}
Note that there are many ways to elude that script:
f! u! c! k!
-f- -u- -c- -k-
FFF UUU CCC KKK
...and so on. While one could extend the script, it would increase the risk of "false positives" at the same time. And there's always another spamming method you couldn't have thought of in advance.
No script can make up for real ops' eyes and brains. wink

Last edited by Horstl; 31/05/10 02:28 PM.
Riamus2 #223070 13/07/10 06:06 PM
Joined: Mar 2010
Posts: 17
V
Venus78 Offline OP
Pikka bird
OP Offline
Pikka bird
V
Joined: Mar 2010
Posts: 17
i really need with code request kick if user are idling in UNO room coz when they ilde ppl got to wait the idler user to play the,so need when ppl typing !idle nick if that nick idle for 1 minute the bot will kick just only in UNO room


on *:TEXT:*!idle*:*: {
if ($1 = !idle) && (%idle.time.get = $null) {
raw whois $2 $2
set %idle.time.get on
set %idle.chan $chan
set %idle.nick $2
}
elseif ($1 = !idle) && (%idle.time.get != $null) {
msg $chan There is currently already an !idle check in progress $nick $+ , please try again in a second!
}
}
raw 317:*:{
if (%idle.time.get = on) {
set %temp.idle.time $3
msg %idle.chan %idle.nick has been idle for $duration(%temp.idle.time)
unset %temp.idle.time
unset %idle.nick
unset %idle.chan
unset %idle.time.get
halt
}
}
[code][/code]

Venus78 #223111 14/07/10 05:05 PM
Joined: Mar 2010
Posts: 17
V
Venus78 Offline OP
Pikka bird
OP Offline
Pikka bird
V
Joined: Mar 2010
Posts: 17
help me the kick not working

on *:TEXT:!idle*:#uno: {
if ($2 == $null) {
/msg $chan you must supply a nickname and optionally a channel.
}
else {
if ($3 == $null) {
if ($2 ison $chan) {
/msg $chan $2 has been idle on $chan for $getnickidle($2,$chan) $+ .
}
else {
/msg $chan $2 is not on $chan $+ .
}
}
elseif ($me ison $3) {
if ($2 ison $3) {
/msg $chan $2 has been idle on $3 for $getnickidle($2,$3) $+ .
}
else {
/msg $chan $2 is not on $3
}
}
else {
/msg $chan I am not on $3 $+ .
}
}
else {
if ($nick($chan,$1).idle > %idletime) { kick $chan $2 You have been idle too long!
}
}
}

alias getnickidle {
/var %x 0
:getnickidleloop
/inc %x
if (%x == $nick($2,$1)) {
/return $duration($nick($2,%x).idle)
}
else {
if (%x < $nick($2,$1)) {
goto getnickidleloop
}
else {
return error
}
}
}

Venus78 #223122 14/07/10 07:21 PM
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
You don't need to loop for the N of <nick> on <chan> like in the getnickidle-alias to get $nick($chan,N).idle. You can do without that loop (and thus without that alias) by using $nick($chan,$nick).idle right away smile
Regarding the kick issue, you put "($nick($chan,$1).idle > %idletime) " which should be ($nick($chan,$2).idle > %idletime)

Below's but a suggestion:
- added the 60s %limit local variable on top, just in case you don't set some global variable elsewhere. If you want to use "%idletime", just rename %limit to %idletime
- merged some conditions
- moved the kick-command (it will now either msg or kick)
- put #$3 in place of $3 in case of an omitted channel prefix
- added the case #$3 == $chan
Code:
on *:TEXT:!idle*:#uno: {
  var %limit = 60
  if (!$2) { msg $chan you must supply a nickname and optionally a channel. }
  else {
    if ((!$3) || (#$3 == $chan)) {
      if ($2 ison $chan) {
        var %idle = $nick($chan,$2).idle
        if (($me isop $chan) && ($2 != $me) && (%idle > %limit)) { kick $chan $2 You have been idle too long! ( $+ $duration(%idle) - limit is $duration(%limit) $+ ) }
        else { msg $chan $2 has been idle on $chan for $duration(%idle) $+ . }
      }
      else { msg $chan $2 is not on $chan $+ . }
    }
    elseif ($me ison #$3) {
      if ($2 ison #$3) { msg $chan $2 has been idle on #$3 for $duration($nick(#$3,$2).idle) $+ . }
      else { msg $chan $2 is not on #$3 $+ . }
    }
    else { msg $chan I am not on #$3 $+ . }
  }
}


P.S. Try to wrap pasted code with the [code][/code] tags wink

Page 2 of 2 1 2

Link Copied to Clipboard