Skip to content
MSN Addons

Need Help in this code

A TG007 community discussion started by nyt1972.

Discussion 27 posts
Page 1 of 2
Open
Topic #5332 · 27 published posts · 2,804 views

Hello everyone,

 

I want my bot to kick for winking so plz check this code coz its not working:

 

#winkkick on
on *:TEXT:*:#: { 
 if ($nick isowner $chan) halt 
 if ($nick isop $chan) halt
 if (admin isin $level($address($nick,6))) halt
 if (ownerlevel isin $level($address($nick,6))) halt
 if (hostlevel isin $level($address($nick,6))) halt
 if (*;)* iswm $1-) { goto winkkick }
 halt
 :winkick
 .sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $address 5 :profanity 
 .sockwrite -tn msn.server. $+ $cid kick $msn.get($cid,fullroom) $nick : $+ Do not wink here; (Access ban set for 5 minutes)[Total Kicks = $+ %kick.count $+ ] 
 set %kick.count $calc(%kick.count +1)
 #winkkick end

I take it the code is for kenobi

anyway the bit in RED is the bit i changed

 

 

#winkkick on

on *:TEXT:*:#: {

if ($nick isowner $chan) halt

if ($nick isop $chan) halt

if (admin isin $level($address($nick,6))) halt

if (ownerlevel isin $level($address($nick,6))) halt

if (hostlevel isin $level($address($nick,6))) halt

if (*$chr(59) $+ $chr(41)* iswm $1-) { goto winkkick }

halt

:winkick

.sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $address 5 :profanity

.sockwrite -tn msn.server. $+ $cid kick $msn.get($cid,fullroom) $nick : $+ Do not wink here; (Access ban set for 5 minutes)[Total Kicks = $+ %kick.count $+ ]

set %kick.count $calc(%kick.count +1)

}

#winkkick end

Edited Nov 27, 2005 5:54 AM by Ozzy10

My code does NOT have bugs. It just develops random features.

ffr, you can't use the literal brackets ((){})in a string when using mirc (or any other programming language for that matter lol); you'd need to use $chr. to find out the chr code for an ascii character you can just use $asc

eg: $asc(,) will return 44 and $chr(44) will return ,

 

hope this helps :)

People are like slinkies; they're generally boring until you push them down stairs

You can use a regular expression in the on text event to catch both ;) and ;-) like this:

 

ON $*:TEXT:/;\-?\)/g:#: {

 

Besides that I think there is a } missing at the bottom of the code

 

set %kick.count $calc(%kick.count +1) is the same as inc %kick.count and that should be placed before the kick to show the right number.

 

I tried the code below which Ozzy told but not working, any problem?

 

#winkkick on
on *:TEXT:*:#: { 
if ($nick isowner $chan) halt 
if ($nick isop $chan) halt
if (admin isin $level($address($nick,6))) halt
if (ownerlevel isin $level($address($nick,6))) halt
if (hostlevel isin $level($address($nick,6))) halt
if (*$chr(59) $+ $chr(41)* iswm $1-) { goto winkkick }
halt
:winkick
.sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $address 5 :profanity 
.sockwrite -tn msn.server. $+ $cid kick $msn.get($cid,fullroom) $nick : $+ Do not wink here; (Access ban set for 5 minutes)[Total Kicks = $+ %kick.count $+ ] 
set %kick.count $calc(%kick.count +1)
}
#winkkick end

try reducing it a bit to narrow down the problem

on 1:text:*:#:{
 if ($nick !isop #) && (; $+ $chr(41) isin $1-) { inc %kick.count | kick # $nick Talking [ $+ %kick.count kicks] }
}

btw, your code says goto winkkick but the code contains winkick

Edited Nov 27, 2005 12:45 PM by Angelia

People are like slinkies; they're generally boring until you push them down stairs

Try this...

 

#winkkick on
on *:TEXT:*:#: { 
if ($nick isowner $chan) halt 
if ($nick isop $chan) halt
if (admin isin $level($address($nick,6))) halt
if (ownerlevel isin $level($address($nick,6))) halt
if (hostlevel isin $level($address($nick,6))) halt
if (* $+ $chr(59) $+ $chr(41) $+ * iswm $1-) || ($chr(59) $+ $chr(41) == $1) { goto winkkick }
halt
:winkick
.sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $address 5 :profanity 
.sockwrite -tn msn.server. $+ $cid kick $msn.get($cid,fullroom) $nick : $+ Do not wink here; (Access ban set for 5 minutes)[Total Kicks = $+ %kick.count $+ ] 
set %kick.count $calc(%kick.count +1)
}
#winkkick end

Just replaced 1 with * and it worked, thanx Intel and thanx every 1.

 

final code is

 

on *:text:*:#:{
 if ($nick !isop #) && (; $+ $chr(41) isin $1-) { inc %kick.count | kick # $nick Talking [ $+ %kick.count kicks] }
}

this should work now

 

 

#winkkick on
on *:TEXT:*:#: { 
if ($nick isowner $chan) halt 
if ($nick isop $chan) halt
if (admin isin $level($address($nick,6))) halt
if (ownerlevel isin $level($address($nick,6))) halt
if (hostlevel isin $level($address($nick,6))) halt
if (* $+ $chr(59) $+ $chr(41) $+ * iswm $1-) { goto winkick }
halt
:winkick {
.sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $address 5 :profanity 
.sockwrite -tn msn.server. $+ $cid kick $msn.get($cid,fullroom) $nick : $+ Do not wink here; (Access ban set for 5 minutes)[Total Kicks = $+ %kick.count $+ ] 
set %kick.count $calc(%kick.count +1)
}
}
#winkkick end

My code does NOT have bugs. It just develops random features.

Thanx ozzy, yes it worked now.

I have another form of the code and smaller than the original 1 <wo0t>

 

#winkkick on
on *:TEXT:*:#: { 
if ($nick isop $chan) || ($level($address($nick,6)) isin admin ownerlevel hostlevel) { halt }
if ($+(*,$chr(59),$chr(41),*) iswm $1-) { goto winkick }
halt
:winkick {
.sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $address 5 :profanity $lf kick $msn.get($cid,fullroom) $nick : $+ Do not wink here; (Access ban set for 5   minutes)[Total Kicks = $+ %kick.count $+ ] 
set %kick.count $calc(%kick.count +1)
}
}
#winkkick end

 

#winkkick on
on *:TEXT:*:#: { 
  if ($nick !isop $chan) && ($level($address($nick,6)) !isin admin ownerlevel hostlevel) && ($+(*,$chr(59),$chr(41),*) iswm $1-) {
    .sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $address 5 :profanity $lf kick $msn.get($cid,fullroom) $nick : $+ Do not wink here; (Access ban set for 5 minutes)
  }
}
#winkkick end

 

Smaller? :P

#winkkick on
on *:TEXT:$+(*,$chr(59),$chr(41),*):#: {
  if ($nick isop $chan) || ($level($ial($nick).addr) isin admin ownerlevel hostlevel) halt
  .sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $address 5 :profanity $lf kick $msn.get($cid,fullroom) $nick : $+ Do not wink here; (Access ban set for 5 minutes)
}
#winkkick end

 

Much smaller :P :P

 

 

#winkkick on
on *:TEXT:$+(*,$chr(59),$chr(41),*):#: {
  if ($nick !isop $chan) && ($level($ial($nick).addr) !isin admin ownerlevel hostlevel) sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $address 5 :profanity $lf kick $msn.get($cid,fullroom) $nick : $+ Do not wink here; (Access ban set for 5 minutes)
}
#winkkick end

 

Very much smaller :P :P

 

 

#winkkick on
on *:TEXT:*;)*:#: {
  if ($nick !isop $chan) && ($level($ial($nick).addr) !isin admin ownerlevel hostlevel) sockwrite -tn msn.server. $+ $cid access $msn.get($cid,fullroom) ADD DENY $address 5 :profanity $lf kick $msn.get($cid,fullroom) $nick : $+ Do not wink here; (Access ban set for 5 minutes)
}
#winkkick end

 

The smalest :P :P

 

#winkkick on
on @1:TEXT:*;)*:#: winkkick
on @1:TEXT:*-;)*:#: winkkick
alias winkkick { access $chan add deny $ial($nick).addr 5 :Wink Kick | kick $chan $nick Don't wink here (Access ban set for 5 minutes) }
#winkkick end

 

even shorter :P And sovers both, though the use of regex will make it even shorter.

Edited Mar 5, 2006 12:08 PM by The Gate Keeper

Everyone figures it out AFTER he needs it.

hay GD i think u did an alias here and the code shouldnt has aliases :P

 

another thing man

on @1:TEXT:*;)*:#: winkkick

on @1:TEXT:*-;)*:#: winkkick

 

i think *;)* include *-;)*

 

looooool right ?? :P

no gk was correct, you can use an alias for a kick and call it from 2 diff items

saves writting the same code a few times

Edited Mar 6, 2006 6:19 AM by Ozzy10

My code does NOT have bugs. It just develops random features.

what he said

hehehe, don't challenge the experience coder :P

on join:#:{ if $nick == The Gate Keeper | kick # $nick Your are to experienced to be here! Go back to the forums. =\ }