<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/15871" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2008-07-27T15:19:57-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/15871</id>

		<entry>
		<author><name><![CDATA[Bahasa]]></name></author>
		<updated>2008-07-27T15:19:57-04:00</updated>

		<published>2008-07-27T15:19:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84195#p84195</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84195#p84195"/>
		<title type="html"><![CDATA[can u make count script on join]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84195#p84195"><![CDATA[
<blockquote class="uncited"><div>thx tueb <br><br> its working 100%</div></blockquote>maybe you need this either for kick/ban counter<div class="codebox"><p>Code: </p><pre><code>#This is a basic kick and join counter. This script requires that #userinfo1.0.tcl is loaded before this script is. And also that KICKS is a #field in the userinfo1.0.tcl script. I would appreciate it, if you left my #nick in the putlog. Any changes, improvements, or problems plz don't hesitate#to email me at abodnar@mail.utexas.edu# --Neuromancer#New to v2.0#------------------------------------------------------------------------------#- Added cmds to let you find out the total amount of joins to a channel by doing #either .totaljoins [#channel] in the bot or !totaljoins [#channel] in the#channel, #channel is optional.#- Added cmds to let you find out the total amount of kicks for a channel #or a person by doing either .totalkicks [nick] in the bot or #!totalkicks [nick] in the channel, nick is optional. #- Cleaned up some of the code dealing w/ the files#- Made the # given when someone joins have the proper ending...#ie. 1 = 1st, 2 = 2nd, 263 = 263rdif {![info exists userinfover] } { putlog "*** Can't load Counter 2.0 -- Userinfo v1.01 required" return 0}bind pub f|f !totaljoins pub:totaljoinsbind dcc f|f totaljoins dcc:totaljoinsbind join -|- * joincounterbind pub f|f !totalkicks pub:totalkicksbind dcc f|f totalkicks dcc:totalkicksbind kick -|- * kickcounterset khits 0set jhits 0proc 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} { if {$arg == ""} {  set temp 0  set chan [lindex [console $idx] 0]  set rchan [string tolower $chan]  if {[file exists ./scripts/$rchan.jcount.txt]} {   set o_fid [open "./scripts/$rchan.jcount.txt" "RDONLY"]   gets $o_fid temp   close $o_fid   putdcc $idx "$temp orang yang sudah berkunjung ke $rchan"   return 0  } else {   putdcc $idx "Sorry, no one has visited $rchan yet"  } } else {  set temp 0  set rchan [string tolower $arg]  if {[file exists ./scripts/$rchan.jcount.txt]} {   set o_fid [open "./scripts/$rchan.jcount.txt" "RDONLY"]   gets $o_fid temp   close $o_fid   putdcc $idx "$temp orang yang sudah berkunjung ke $rchan"   return 0  } else {   putdcc $idx "Sorry, no one has visited $rchan yet"  } }}proc pub:totaljoins {nick host hand chan arg} { if { $arg == "" } {  set temp 0  set rchan [string tolower $chan]  if {[file exists ./scripts/$rchan.jcount.txt]} {   set o_fid [open "./scripts/$rchan.jcount.txt" "RDONLY"]   gets $o_fid temp   close $o_fid   putserv "PRIVMSG $chan :$temp orang yang sudah berkunjung ke $chan"   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 ./scripts/$rchan.jcount.txt]} {   set o_fid [open "./scripts/$rchan.jcount.txt" "RDONLY"]   gets $o_fid temp   close $o_fid   putserv "PRIVMSG $chan :$temp orang yang sudah berkunjung ke $rchan"   return 0  } else {   putserv "PRIVMSG $chan :Sorry, no one has visited $rchan yet"  } }} proc joincounter {nick host hand chan} { global jhits set temp 0 set rchan [string tolower $chan] if {[file exists ./scripts/$rchan.jcount.txt]} {  set o_fid [open "./scripts/$rchan.jcount.txt" "RDONLY"]  gets $o_fid temp  close $o_fid } else {  set o_fid [open "./scripts/$rchan.jcount.txt" "CREAT RDWR"]  puts $o_fid temp  close $o_fid } set jhits $temp incr jhits putserv "NOTICE $nick :selamat datang. kamu adalah orang ke [convert $jhits] yang sudah berkunjung ke $chan" set o_id [open "./scripts/$rchan.jcount.txt" "WRONLY"] puts $o_id $jhits close $o_id}proc dcc:totalkicks {hand idx arg} { if {$arg == ""} {  set temp 0  set chan [lindex [console $idx] 0]  set rchan [string tolower $chan]  if {[file exists ./scripts/$rchan.kcount.txt]} {   set o_fid [open "./scripts/$rchan.kcount.txt" "RDONLY"]   gets $o_fid temp   close $o_fid   putdcc $idx "$temp people have been kicked from $rchan"   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"   }  } else {   putdcc $idx "I do not know who $arg is"  } }}        proc pub:totalkicks {nick host hand chan arg} { if {$arg == ""} {  set temp 0  set rchan [string tolower $chan]  if {[file exists ./scripts/$rchan.kcount.txt]} {   set o_fid [open "./scripts/$rchan.kcount.txt" "RDONLY"]   gets $o_fid temp   close $o_fid   putserv "PRIVMSG $chan :$temp people have been kicked from $rchan"   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"   } else {    set tkicks [getuser $nick XTRA KICKS]    putserv "PRIVMSG $chan :$arg has kicked $tkicks lamers"   }  } else {   putserv "PRIVMSG $chan :I do not know who $arg is"  } }}proc kickcounter {nick host hand chan knick reason} { global khits set temp 0 set rchan [string tolower $chan] if {[file exists ./scripts/$rchan.kcount.txt]} {  set o_fid [open "./scripts/$rchan.kcount.txt" "RDONLY"]  gets $o_fid temp  close $o_fid } else {  set o_fid [open "./scripts/$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  putserv "PRIVMSG $chan :$nick udah ngekick $tkicks nickname. siapa selanjutnya? hehehe" } putserv "NOTICE $knick :kamu adalah orang ke [convert $khits] yang sudah di kick dari $chan" putserv "PRIVMSG $chan :$knick adalah orang ke [convert $khits] yang sudah di kick dari $chan" set o_id [open "./scripts/$rchan.kcount.txt" "WRONLY"] puts $o_id $khits close $o_id}putlog "Join &amp; Kick Counter v2.1 by Neuromancer"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10081">Bahasa</a> — Sun Jul 27, 2008 3:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2008-06-30T10:49:55-04:00</updated>

		<published>2008-06-30T10:49:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83809#p83809</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83809#p83809"/>
		<title type="html"><![CDATA[can u make count script on join]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83809#p83809"><![CDATA[
Such a script already exists. Search the <a href="http://www.egghelp.org/tcl.htm" class="postlink">Tcl Archive</a>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Jun 30, 2008 10:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[4mirc]]></name></author>
		<updated>2008-06-29T20:00:07-04:00</updated>

		<published>2008-06-29T20:00:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83803#p83803</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83803#p83803"/>
		<title type="html"><![CDATA[can u make count script on join]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83803#p83803"><![CDATA[
thx tueb <br><br> its working 100%<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9924">4mirc</a> — Sun Jun 29, 2008 8:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tueb]]></name></author>
		<updated>2008-06-28T04:13:42-04:00</updated>

		<published>2008-06-28T04:13:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83764#p83764</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83764#p83764"/>
		<title type="html"><![CDATA[can u make count script on join]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83764#p83764"><![CDATA[
hi,<br><br>this might work:<br><br><div class="codebox"><p>Code: </p><pre><code>bind join - * chan_on_joinedproc chan_on_joined {nick host handle channel} { set fname "count.txt" ##  if {![file exists $fname]} {    set file [open $fname w]    puts $file "0"    close $file } ## set file [open $fname "r"] set data [read -nonewline $file] close $file set newdata [incr data] set greet_text "Hi $nick! You are the user number $newdata joining $channel." puthelp "PRIVMSG $channel :$greet_text" set file [open $fname w] puts $file $newdata close $file}</code></pre></div>this part could be deleted after the first try. it only creates the count.txt once:<br><div class="codebox"><p>Code: </p><pre><code> ##  if {![file exists $fname]} {    set file [open $fname w]    puts $file "0"    close $file } ##</code></pre></div>tueb<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9349">tueb</a> — Sat Jun 28, 2008 4:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[4mirc]]></name></author>
		<updated>2008-06-28T00:40:05-04:00</updated>

		<published>2008-06-28T00:40:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=83761#p83761</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=83761#p83761"/>
		<title type="html"><![CDATA[can u make count script on join]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=83761#p83761"><![CDATA[
hi all<br><br> can any 1 make script for my bot to count users on join <br><br> i mean when any user join chan let the bot notice him <br><br> <strong class="text-strong">hi 4mirc You are the user nuber 1 joining  this chan</strong><br><br>and for example next user join her nick sara <br><br> let the bot notice her<br><br> <strong class="text-strong">hi sara You are the user nuber 2 joining this chan</strong><br><br> im waiting and thx<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9924">4mirc</a> — Sat Jun 28, 2008 12:40 am</p><hr />
]]></content>
	</entry>
	</feed>
