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.

On-Join message to mode +o users

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

On-Join message to mode +o users

Post by cache »

Looking for a script that sends a message I have set to users who join room with mode +o

* Joins: User (User@User)
* User sets mode: +o User
Bot: Private Message: Hello User...
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

bind mode - "* +o" hello:user

proc hello:user {nick uhost hand chan mc targ} {
 if {[unixtime] - [getchanjoin $targ $chan] <= 3} {
  puthelp "privmsg $targ :Hello $targ"
 }
}
This will msg the user if he gets oped after 3 or less seconds from joining the channel.
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

bind MODE -|- * welcome:msg

proc welcome:msg {nickname hostname handle channel mode target} {
  if {$mode == "+o"} {
    if {[expr [clock seconds] - [getchanjoin $target $channel]] < 5} {
      putmsg $channel "Hello $target.."
    }
  }
}

Heh, he beat me to it :)
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

Do these only work on +o flags? I tried to make one for a different flag it did nothing.

Like a z flag

* Joins: User (User@User)
* User sets mode: +z User
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

Only ops see +z btw, chatters don't... bot is oped and sees:

[12:16] #chan: mode change '+z user' by user!user@user

and I tried changing +o to +z

Code: Select all

bind mode - "* +z" hello:user 

proc hello:user {nick uhost hand chan mc targ} { 
 if {[unixtime] - [getchanjoin $targ $chan] <= 5} { 
  puthelp "privmsg $targ :Hello $targ" 
 } 
}
Seems it only works with +o :(
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

I use a nice little script called "flag on join" from the tcl archive. It can send different msgs to non-users, or different flagged users, etc. Very handy. My only complaint is it doesn't handle multiple flags within 1 message, but, eh small bother and I'm too lazy to fix it myself :)

Displays on-join messages to users with certain flags. Messages can be added, removed, etc. via DCC commands.
http://www.egghelp.org/cgi-bin/tcl_arch ... oad&id=126
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

Yes I tried that already wouldn't work on +z users nor do the options above.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

set flags "mntofpjvxa\*" ;# Allowed flags..

Change that part of the flagonjoin script then it'll let you use +z or whatever other flags you want :)

I've done some other minor mods to this script, mostly formatting the output a little better, adding more help, and a couple of small bugfixes, I'll post it here:

http://members.dandy.net/~fbn/flagonjoin_rosc.tcl.txt
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

but msg can only be set by DCC? server has DCC blocked
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

I usually hand-edit the flagmsg file, but if that is not an option, just make a msg bind for the script:

Code: Select all

bind msg n onjoin msg:onjoin_addmsg
proc msg:onjoin_addmsg {nick uhost handle arg} {

copy the dcc:onjoin_addmsg proc's code and change all instances of 
putidx $idx with puthelp "PRIVMSG $nick :etc"
}

and that should do the trick
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

ok you confused me lol, i'll have to sit down and puzzle all this together.
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

You say 'copy the dcc:onjoin_addmsg proc's code ' I copy and do what with it?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

copy the dcc:onjoin_addmsg proc's code into the new msg:onjoin_addmsg proc
c
cache
Master
Posts: 306
Joined: Tue Jan 10, 2006 4:59 am
Location: Mass

Post by cache »

Ok I got script working but..

I did..
onjoin add #chan +z Test here

[5:39pm] <Bot> Stored the msg.

I join +z and nothing happened..

It works if I store a msg for +o, wonder why +z is so complicated.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

I put another mod on the same url above to include the msg bind and the z flag, note the permissions for the msg bind are for +n users. The mod works for me. I tested it with the +z flag as well, using both a spefic channel name and just a * for all channels, this is what it looks like in the data file:

Either one of these worked just fine:
z #mychannel foobar biz
z * fooboobarbiz

Test user logged in/joined channel:
-TheEntity(~TheEntity@TheEntity.funo.oper)- foobar biz
-TheEntity(~TheEntity@TheEntity.funo.oper)- fooboobarbiz
Post Reply