egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

On-Join message to mode +o users
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sun Nov 12, 2006 11:56 am    Post subject: On-Join message to mode +o users Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Nov 12, 2006 12:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sun Nov 12, 2006 12:23 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sun Nov 12, 2006 12:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sun Nov 12, 2006 1:23 pm    Post subject: Reply with quote

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 Sad
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Nov 12, 2006 1:25 pm    Post subject: Reply with quote

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 Smile

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
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sun Nov 12, 2006 1:27 pm    Post subject: Reply with quote

Yes I tried that already wouldn't work on +z users nor do the options above.
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Nov 12, 2006 1:39 pm    Post subject: Reply with quote

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 Smile

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
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sun Nov 12, 2006 1:44 pm    Post subject: Reply with quote

but msg can only be set by DCC? server has DCC blocked
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Nov 12, 2006 1:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sun Nov 12, 2006 1:57 pm    Post subject: Reply with quote

ok you confused me lol, i'll have to sit down and puzzle all this together.
Back to top
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sun Nov 12, 2006 2:17 pm    Post subject: Reply with quote

You say 'copy the dcc:onjoin_addmsg proc's code ' I copy and do what with it?
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Nov 12, 2006 3:24 pm    Post subject: Reply with quote

copy the dcc:onjoin_addmsg proc's code into the new msg:onjoin_addmsg proc
Back to top
View user's profile Send private message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sun Nov 12, 2006 6:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Nov 12, 2006 7:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber