| View previous topic :: View next topic |
| Author |
Message |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sun Nov 12, 2006 11:56 am Post subject: On-Join message to mode +o users |
|
|
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... |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Nov 12, 2006 12:23 pm Post subject: |
|
|
| Code: | 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. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sun Nov 12, 2006 12:23 pm Post subject: |
|
|
| Code: | 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  |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sun Nov 12, 2006 12:54 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sun Nov 12, 2006 1:23 pm Post subject: |
|
|
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: | 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  |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Nov 12, 2006 1:25 pm Post subject: |
|
|
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_archive.tcl?mode=download&id=126 |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sun Nov 12, 2006 1:27 pm Post subject: |
|
|
| Yes I tried that already wouldn't work on +z users nor do the options above. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Nov 12, 2006 1:39 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sun Nov 12, 2006 1:44 pm Post subject: |
|
|
| but msg can only be set by DCC? server has DCC blocked |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Nov 12, 2006 1:50 pm Post subject: |
|
|
I usually hand-edit the flagmsg file, but if that is not an option, just make a msg bind for the script:
| Code: |
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
|
|
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sun Nov 12, 2006 1:57 pm Post subject: |
|
|
| ok you confused me lol, i'll have to sit down and puzzle all this together. |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sun Nov 12, 2006 2:17 pm Post subject: |
|
|
| You say 'copy the dcc:onjoin_addmsg proc's code ' I copy and do what with it? |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Nov 12, 2006 3:24 pm Post subject: |
|
|
| copy the dcc:onjoin_addmsg proc's code into the new msg:onjoin_addmsg proc |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sun Nov 12, 2006 6:45 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Nov 12, 2006 7:16 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
|