This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

forced -e

Old posts that have not been replied to for several years.
Locked
V
Vixs
Voice
Posts: 12
Joined: Sat May 15, 2004 1:41 am

forced -e

Post by Vixs »

Actually i wanted to prevent people from setting +e on themlseves or others on chan, i managed to put around some coding

Code: Select all

bind mode -|- "% +e" forcemod 
proc forcemod {nick uhost hand chan args} {
set modechange [join $args]
if {[scan $modechange "+e %s" $chan] != 1} { return }
global botnick
putquick “MODE $chan –e $nick” -next
   }
I dunno how far this is right, but this does the execution like

Vixs sets mode: +e somenick!*@*
* RockBabe sets mode: -e Vixs!*@*
Instead of -e somenick , its doing the reverse.
How can the bot -e the target ie somenick in this case.
Please Help me correct the code.
thanks
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Something like this is more simpler indeed.

Code: Select all

bind mode - "*+e*" force:mode

proc force:mode {nick uhost hand chan mode target} {
 if {[botisop $chan] && ![isbotnick $nick]} {
  putquick "MODE $chan –e $target" -next
  }
}
You can check in the bind for "*+e*" or check in the procedure for +e, if {[string match "*+e*" $mode]}, depending upon which ever you prefer.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
V
Vixs
Voice
Posts: 12
Joined: Sat May 15, 2004 1:41 am

Post by Vixs »

thanks a lot awyeah :P
o
overfly
Voice
Posts: 8
Joined: Fri Jan 07, 2005 6:02 am

Post by overfly »

Can there be a trigger built in? For example !stop-e So the Bot stops pushing -e !


Greetz

overfly
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

foreach echan [channels] {
 set forcee([string tolower $echan]) 1
}

bind mode - "* +e" force:mode
bind pub m * stop:mode

proc force:mode {nick uhost hand chan mode target} { 
 global forcee
 if {(![isbotnick $nick]) && ([botisop $chan]) && ($forcee([string tolower $chan) == 1)} { 
  putquick "MODE $chan –e $target" -next 
  } 
}

proc stop:mode {nick uhost hand chan arg} {
 global forcee
 if {[string equal -nocase "!stop-e" "[lindex [split $arg] 0]"]} {
  set forcee([string tolower $chan]) 0
  return 0
 }
 if {[string equal -nocase "!start-e" "[lindex [split $arg] 0]"]} {
  set forcee([string tolower $chan]) 1
  return 0
 }
}
!stop-e !start-e to disable or enable.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

if you do something like

Code: Select all

bind pub m !stop-e "{stop:mode} {0}"
bind pub m !start-e "{stop:mode} {1}"

proc stop:mode {force nick uhost hand chan arg} {
  set ::forcee([string tolower $chan]) $force
}
you can save a lot of code... i dont know about speed, but i don't know why it should be slow :).
you could even skip the string tolower, the channel name capitalization will always be the same for the bot.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

That looks new for me, thanx for sharing.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

I didnt know you could pass a variable in a bind either. Can you pass strings as well as integers?
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

^DooM^ wrote:I didnt know you could pass a variable in a bind either. Can you pass strings as well as integers?
anything is possible, you can even supply configurable variables as content like in my chanservneed script.
However, these {} are not redudant of course, we need an explicit list and not just a whitespace containing string ^-^. I tried to use
  • and such things, but they somehow dont neccearyly do the same.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

De Kus wrote:However, these {} are not redudant of course, we need an explicit list and not just a whitespace containing string ^-^. I tried to use
  • and such things, but they somehow dont neccearyly do the same.
They're redundant...the right "hand made" list would be {stop:mode 0}, but you should always use the list commands to create lists to avoid problems and redundant string->list conversions.

btw: why not just .chanset #theChan -userexempts?
Have you ever read "The Manual"?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

user wrote:They're redundant...the right "hand made" list would be {stop:mode 0}, but you should always use the list commands to create lists to avoid problems and redundant string->list conversions.
yeah in this case they are really, sorry, but in some cases they aren't. Maybe only when "eval" is involved, I don't exactly know it either, at least this one works always while
  • gave me a headache from time to time, that I can tell you for sure. I have been working a while abusing egghttp and fileevent to handle over someextra vars. Anything but this {} thing often (not always) caused problems, especially if there are more than 1 extra argument. Since I am a lazy guy I don't want to try and findle with
    • first, when no userinput is stored in this list and I can easily just use {} ^-^.
      user wrote:btw: why not just .chanset #theChan -userexempts?
      hmm, I believe the bot wouldn't reject exempts from +o users, would he? Probably he doesn't really believe in his chan ops ^-^.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Locked