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 Greet + Counter!!!

Old posts that have not been replied to for several years.
Locked
m
mrgenius

On Join Greet + Counter!!!

Post by mrgenius »

Hello All :roll:

i don't know how to script tcl.. isliye i need little help From you guyz or galz.... I need a Script on Which I can Set a on join Channel notice message for each Channel.. and at the end of message append the Join Count of that Channel...

so if any one have such script then gimme... Or else i am attaching Code of 2 different Scriptss.. One is On join Noticer.. and other is kcick/join Counter... please merge them in the way I described...

Waiting for Positive Response...

.:: Asad ul-Islam ::.
=================================
on join message Script
=================================
# Multi Onjoin Messages

set ojcham {
{#ku-dcs} {Welcome to Official Channel of DCS,KU! Please Follow the Rules on http://www.ku-dcs.rules.it , And Remember We will not tolerate any Sort of Political Discussions on Channel.}
}

# Do you want to use notices, or private messages - 0=notice - anything else=private message
# Notices goto the user, while private messages goto the channel
set ojtom 0

# THIS IS THE SCRIPT, SURE YA WANNA TOUCH

bind join - "*" oj:chan:message
proc oj:chan:message {nick uh hand chan} {
global ojcham ojtom
if {[set id [lsearch -exact [string tolower $ojcham] [string tolower $chan]]] != -1} {
if {$ojtom == "0"} {
putserv "NOTICE $nick :[lindex $ojcham [expr $id + 1]]"
} {
putserv "PRIVMSG $chan :[lindex $ojcham [expr $id + 1]]"
}
}
}


===============================
Counter Script
===============================
#Counter script

if {![info exists userinfover] } {
putlog "*** Can't load Counter 2.0 -- Userinfo v1.01 required"
return 0
}

bind pub o|o !totaljoins pub:totaljoins
bind dcc o|o totaljoins dcc:totaljoins
bind join -|- * joincounter
bind pub o|o !totalkicks pub:totalkicks
bind dcc o|o totalkicks dcc:totalkicks
bind kick -|- * kickcounter
set khits 0
set jhits 0

proc convert {number} {
set one st
set two nd
set three rd
set others th
set numlength [string length $number]
incr numlength -2
set num2ndchar [string index $number $numlength]
switch $num2ndchar {
1 { set number $number$others }
default {
incr numlength
set numchar [string index $number $numlength]
switch $numchar {
1 { set number $number$one }
2 { set number $number$two }
3 { set number $number$three }
default { set number $number$others }
}
}
}
return $number
}

proc dcc:totaljoins {hand idx arg} {
global ojkdate
if {$arg == ""} {
set temp 0
set chan [lindex [console $idx] 0]
set rchan [string tolower $chan]
if {[file exists $rchan.jcount.txt]} {
set o_fid [open "$rchan.jcount.txt" "RDONLY"]
gets $o_fid temp
close $o_fid
putdcc $idx "$temp people have visited $rchan $ojkdate"
return 0
} else {
putdcc $idx "Sorry, no one has visited $rchan yet"
}
} else {
set temp 0
set rchan [string tolower $arg]
if {[file exists $rchan.jcount.txt]} {
set o_fid [open "$rchan.jcount.txt" "RDONLY"]
gets $o_fid temp
close $o_fid
putdcc $idx "$temp people have visited $rchan since ojkdate"
return 0
} else {
putdcc $idx "Sorry, no one has visited $rchan yet"
}
}
}

proc pub:totaljoins {nick host hand chan arg} {
global ojkdate cccversion
if { $arg == "" } {
set temp 0
set rchan [string tolower $chan]
if {[file exists $rchan.jcount.txt]} {
set o_fid [open "$rchan.jcount.txt" "RDONLY"]
gets $o_fid temp
close $o_fid
putserv "PRIVMSG $chan :$temp people have visited $chan since $ojkdate $cccversion StaTs"
return 0
} else {
putserv "PRIVMSG $chan :Sorry, no one has visited $rchan yet"
}
} else {
set temp 0
set rchan [string tolower $arg]
if {[file exists $rchan.jcount.txt]} {
set o_fid [open "$rchan.jcount.txt" "RDONLY"]
gets $o_fid temp
close $o_fid
putserv "PRIVMSG $chan :$temp people have visited $rchan since $ojkdate $cccversion StaTs"
return 0
} else {
putserv "PRIVMSG $chan :Sorry, no one has visited $rchan yet"
}
}
}
proc joincounter {nick host hand chan} {
global jhits ojkdate ojswitch cccversion onjoin_chans botnick
set temp 0
set rchan [string tolower $chan]
if {[file exists $rchan.jcount.txt]} {
set o_fid [open "$rchan.jcount.txt" "RDONLY"]
gets $o_fid temp
close $o_fid
} else {
set o_fid [open "$rchan.jcount.txt" "CREAT RDWR"]
puts $o_fid temp
close $o_fid
}
set jhits $temp
incr jhits
if {(([lsearch -exact [string tolower $onjoin_chans] [string tolower $chan]] != -1) || ($onjoin_chans == "*")) && (![matchattr $hand b]) && ($nick != $botnick)} {
if {$ojswitch == "on"} {putserv "NOTICE $nick : $nick :) You are the [convert $jhits] person to join us since $ojkdate . $cccversion "}
}
set o_id [open "$rchan.jcount.txt" "WRONLY"]
puts $o_id $jhits
close $o_id
}


proc dcc:totalkicks {hand idx arg} {
global ojkdate cccversion
if {$arg == ""} {
set temp 0
set chan [lindex [console $idx] 0]
set rchan [string tolower $chan]
if {[file exists $rchan.kcount.txt]} {
set o_fid [open "$rchan.kcount.txt" "RDONLY"]
gets $o_fid temp
close $o_fid
putdcc $idx "$temp people have been kicked from $rchan since $ojkdate $cccversion STaTs"
return 0
} else {
putdcc $idx "Sorry, no one has been kicked from $rchan yet"
}
} else {
set temp 0
set nick [string tolower $arg]
if {[validuser $nick]} {
if {[getuser $nick XTRA KICKS] == ""} {
putdcc $idx "$arg hasn't kicked anyone yet"
} else {
set tkicks [getuser $nick XTRA KICKS]
putdcc $idx "$arg has kicked $tkicks lamers since $ojkdate $cccversion STaTs"
}
} else {
putdcc $idx "I do not know who $arg is"
}
}
}

proc pub:totalkicks {nick host hand chan arg} {
global ojkdate cccversion
if {$arg == ""} {
set temp 0
set rchan [string tolower $chan]
if {[file exists $rchan.kcount.txt]} {
set o_fid [open "$rchan.kcount.txt" "RDONLY"]
gets $o_fid temp
close $o_fid
putserv "PRIVMSG $chan :$temp people have been kicked from $rchan since $ojkdate $cccversion STaTs"
return 0
} else {
putserv "PRIVMSG $chan :Sorry, no one has been kicked from $rchan yet"
}
} else {
set temp 0
set nick [string tolower $arg]
if {[validuser $nick]} {
if {[getuser $nick XTRA KICKS] == ""} {
putserv "PRIVMSG $chan :$arg hasn't kicked anyone yet $cccversion StaTs"
} else {
set tkicks [getuser $nick XTRA KICKS]
putserv "PRIVMSG $chan :$arg has kicked $tkicks lamers since $ojkdate $cccversion StaTs"
}
} else {
putserv "PRIVMSG $chan :I do not know who $arg is"
}
}
}

proc kickcounter {nick host hand chan knick reason} {
global khits cccversion
set temp 0
set rchan [string tolower $chan]
if {[file exists $rchan.kcount.txt]} {
set o_fid [open "$rchan.kcount.txt" "RDONLY"]
gets $o_fid temp
close $o_fid
} else {
set o_fid [open "$rchan.kcount.txt" "CREAT RDWR"]
puts $o_fid temp
close $o_fid
}
set khits $temp
incr khits
if {[validuser [nick2hand $nick $chan]]} {
if {[getuser $hand XTRA KICKS] == ""} {
setuser $hand XTRA KICKS 0
}
set tkicks [getuser $hand XTRA KICKS]
incr tkicks
setuser $hand XTRA KICKS $tkicks
}
set o_id [open "$rchan.kcount.txt" "WRONLY"]
puts $o_id $khits
close $o_id
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

ok, mixing the two scripts together (in a neat way :p):

Code: Select all

###configurations###
set ojcham { 
{#ku-dcs} {Welcome to Official Channel of DCS,KU! Please Follow the Rules on http://www.ku-dcs.rules.it , And Remember We will not tolerate any Sort of Political Discussions on Channel.} 
} 

# Do you want to use notices, or private messages - 0=notice - anything else=private message 
# Notices goto the user, while private messages goto the channel 
set ojtom 0

###code starts here###

if {![info exists userinfover] } { 
putlog "*** Can't load Greet&Counter2.0 -- Userinfo v1.01 required" 
return 0 
}

bind join - "*" oj:chan:message 
bind pub o|o !totaljoins pub:totaljoins 
bind dcc o|o totaljoins dcc:totaljoins 
bind join -|- * joincounter 
bind pub o|o !totalkicks pub:totalkicks 
bind dcc o|o totalkicks dcc:totalkicks 
bind kick -|- * kickcounter 

proc oj:chan:message {nick uh hand chan} { 
global ojcham ojtom 
if {[set id [lsearch -exact [string tolower $ojcham] [string tolower $chan]]] != -1} { 
if {$ojtom == "0"} { 
putserv "NOTICE $nick :[lindex $ojcham [expr $id + 1]]" 
} { 
putserv "PRIVMSG $chan :[lindex $ojcham [expr $id + 1]]" 
} 
} 
}

set khits 0 
set jhits 0 

proc convert {number} { 
set one st 
set two nd 
set three rd 
set others th 
set numlength [string length $number] 
incr numlength -2 
set num2ndchar [string index $number $numlength] 
switch $num2ndchar { 
1 { set number $number$others } 
default { 
incr numlength 
set numchar [string index $number $numlength] 
switch $numchar { 
1 { set number $number$one } 
2 { set number $number$two } 
3 { set number $number$three } 
default { set number $number$others } 
} 
} 
} 
return $number 
} 

proc dcc:totaljoins {hand idx arg} { 
global ojkdate 
if {$arg == ""} { 
set temp 0 
set chan [lindex [console $idx] 0] 
set rchan [string tolower $chan] 
if {[file exists $rchan.jcount.txt]} { 
set o_fid [open "$rchan.jcount.txt" "RDONLY"] 
gets $o_fid temp 
close $o_fid 
putdcc $idx "$temp people have visited $rchan $ojkdate" 
return 0 
} else { 
putdcc $idx "Sorry, no one has visited $rchan yet" 
} 
} else { 
set temp 0 
set rchan [string tolower $arg] 
if {[file exists $rchan.jcount.txt]} { 
set o_fid [open "$rchan.jcount.txt" "RDONLY"] 
gets $o_fid temp 
close $o_fid 
putdcc $idx "$temp people have visited $rchan since ojkdate" 
return 0 
} else { 
putdcc $idx "Sorry, no one has visited $rchan yet" 
} 
} 
} 

proc pub:totaljoins {nick host hand chan arg} { 
global ojkdate cccversion 
if { $arg == "" } { 
set temp 0 
set rchan [string tolower $chan] 
if {[file exists $rchan.jcount.txt]} { 
set o_fid [open "$rchan.jcount.txt" "RDONLY"] 
gets $o_fid temp 
close $o_fid 
putserv "PRIVMSG $chan :$temp people have visited $chan since $ojkdate $cccversion StaTs" 
return 0 
} else { 
putserv "PRIVMSG $chan :Sorry, no one has visited $rchan yet" 
} 
} else { 
set temp 0 
set rchan [string tolower $arg] 
if {[file exists $rchan.jcount.txt]} { 
set o_fid [open "$rchan.jcount.txt" "RDONLY"] 
gets $o_fid temp 
close $o_fid 
putserv "PRIVMSG $chan :$temp people have visited $rchan since $ojkdate $cccversion StaTs" 
return 0 
} else { 
putserv "PRIVMSG $chan :Sorry, no one has visited $rchan yet" 
} 
} 
} 
proc joincounter {nick host hand chan} { 
global jhits ojkdate ojswitch cccversion onjoin_chans botnick 
set temp 0 
set rchan [string tolower $chan] 
if {[file exists $rchan.jcount.txt]} { 
set o_fid [open "$rchan.jcount.txt" "RDONLY"] 
gets $o_fid temp 
close $o_fid 
} else { 
set o_fid [open "$rchan.jcount.txt" "CREAT RDWR"] 
puts $o_fid temp 
close $o_fid 
} 
set jhits $temp 
incr jhits 
if {(([lsearch -exact [string tolower $onjoin_chans] [string tolower $chan]] != -1) || ($onjoin_chans == "*")) && (![matchattr $hand b]) && ($nick != $botnick)} { 
if {$ojswitch == "on"} {putserv "NOTICE $nick : $nick  You are the [convert $jhits] person to join us since $ojkdate . $cccversion "} 
} 
set o_id [open "$rchan.jcount.txt" "WRONLY"] 
puts $o_id $jhits 
close $o_id 
} 


proc dcc:totalkicks {hand idx arg} { 
global ojkdate cccversion 
if {$arg == ""} { 
set temp 0 
set chan [lindex [console $idx] 0] 
set rchan [string tolower $chan] 
if {[file exists $rchan.kcount.txt]} { 
set o_fid [open "$rchan.kcount.txt" "RDONLY"] 
gets $o_fid temp 
close $o_fid 
putdcc $idx "$temp people have been kicked from $rchan since $ojkdate $cccversion STaTs" 
return 0 
} else { 
putdcc $idx "Sorry, no one has been kicked from $rchan yet" 
} 
} else { 
set temp 0 
set nick [string tolower $arg] 
if {[validuser $nick]} { 
if {[getuser $nick XTRA KICKS] == ""} { 
putdcc $idx "$arg hasn't kicked anyone yet" 
} else { 
set tkicks [getuser $nick XTRA KICKS] 
putdcc $idx "$arg has kicked $tkicks lamers since $ojkdate $cccversion STaTs" 
} 
} else { 
putdcc $idx "I do not know who $arg is" 
} 
} 
} 

proc pub:totalkicks {nick host hand chan arg} { 
global ojkdate cccversion 
if {$arg == ""} { 
set temp 0 
set rchan [string tolower $chan] 
if {[file exists $rchan.kcount.txt]} { 
set o_fid [open "$rchan.kcount.txt" "RDONLY"] 
gets $o_fid temp 
close $o_fid 
putserv "PRIVMSG $chan :$temp people have been kicked from $rchan since $ojkdate $cccversion STaTs" 
return 0 
} else { 
putserv "PRIVMSG $chan :Sorry, no one has been kicked from $rchan yet" 
} 
} else { 
set temp 0 
set nick [string tolower $arg] 
if {[validuser $nick]} { 
if {[getuser $nick XTRA KICKS] == ""} { 
putserv "PRIVMSG $chan :$arg hasn't kicked anyone yet $cccversion StaTs" 
} else { 
set tkicks [getuser $nick XTRA KICKS] 
putserv "PRIVMSG $chan :$arg has kicked $tkicks lamers since $ojkdate $cccversion StaTs" 
} 
} else { 
putserv "PRIVMSG $chan :I do not know who $arg is" 
} 
} 
} 

proc kickcounter {nick host hand chan knick reason} { 
global khits cccversion 
set temp 0 
set rchan [string tolower $chan] 
if {[file exists $rchan.kcount.txt]} { 
set o_fid [open "$rchan.kcount.txt" "RDONLY"] 
gets $o_fid temp 
close $o_fid 
} else { 
set o_fid [open "$rchan.kcount.txt" "CREAT RDWR"] 
puts $o_fid temp 
close $o_fid 
} 
set khits $temp 
incr khits 
if {[validuser [nick2hand $nick $chan]]} { 
if {[getuser $hand XTRA KICKS] == ""} { 
setuser $hand XTRA KICKS 0 
} 
set tkicks [getuser $hand XTRA KICKS] 
incr tkicks 
setuser $hand XTRA KICKS $tkicks 
} 
set o_id [open "$rchan.kcount.txt" "WRONLY"] 
puts $o_id $khits 
close $o_id 
}
m
mrgenius

Post by mrgenius »

Its not Working

I guess You didn't get me.. Right now its showing me Notice in 2 lines. Like this

Code: Select all

[17:14] -Pareshan- Gen|us_Away You are the 4179th person to join us since March 23, 2003 . Gen|us-BaWT  0.01a
[17:14] -Pareshan- Welcome to Official Channel of DCS,KU! Please Follow the Rules on http://www.ku-dcs.rules.it , And Remember We will not tolerate any Sort of Political Discussions on Channel.
But i want it to show me All this in Single NOtice... Like this

Code: Select all

-Pareshan- Welcome to Official Channel of DCS,KU! Please Follow the Rules on http://www.ku-dcs.rules.it , And Remember We will not tolerate any Sort of Political Discussions on Channel. Gen|us_Away You are the 4179th person to join us since March 23, 2003 . Gen|us-BaWT  0.01a
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

oh, well that I think need alot of brain power, I'm not in the mood for it right now, anyway try to make it your self. Since u need it so bad.
Locked