<?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/18737" />

	<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>2011-12-06T02:05:28-04:00</updated>

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

		<entry>
		<author><name><![CDATA[LinkinPark]]></name></author>
		<updated>2011-12-06T02:05:28-04:00</updated>

		<published>2011-12-06T02:05:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98329#p98329</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98329#p98329"/>
		<title type="html"><![CDATA[Needed help with !rep]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98329#p98329"><![CDATA[
Thank to willyw.. it's working now..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11651">LinkinPark</a> — Tue Dec 06, 2011 2:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2011-12-05T11:23:50-04:00</updated>

		<published>2011-12-05T11:23:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98323#p98323</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98323#p98323"/>
		<title type="html"><![CDATA[Needed help with !rep]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98323#p98323"><![CDATA[
<blockquote class="uncited"><div>...<br>it's only work with voice'ed users to check !rep and nick++<br><br>for op'ed users can not check it..</div></blockquote><br>Try this:<br><div class="codebox"><p>Code: </p><pre><code>## Rep.tcl-v.1.1.0## Author: Luminous## Support: pm on egghelp.org## This is a public script for voiced and opped users to add or remove reputation points to/from users. Its intended use is to keep track of positively and negatively contributing users, similar to forums with reputation systems. Points will be logged to the file "~/eggdrop/reps.txt". Note that everyone starts off at 0 or "neutral" points and does not show up as having reputation via !rep or !rep NICK until they reach negative or positive points. If points are removed from a user not in the file, they are automatically given -1. If rep is added to a user not in the file, they are automatically given 1. The plus/minus increments work normally from there unless the user reaches 0, or neutral, again.## Commands# All commands are public# To add a reputation point to a user, use "NICK++"# To remove a reputation point, use "NICK--"# To view the reputation points of a specific user, use "!rep NICK"# To view all reputation, use "!rep". A list will be noticed you slowly to avoid flooding.# Set below the char you want to trigger the "rep" functions with:set bchar "!"## Code starts, edit beyond here at your own risk### bind pubm * * repbind pubm - "* *" rep proc rep {nick host hand chan text} { global bchar    if {[regexp -nocase {^\S+\+\+$} $text] || [regexp -nocase {^\S+--$} $text] || [regexp "^${bchar}rep.*" $text]} {           if { ( ![isvoice $nick $chan] ) &amp;&amp; ( ![isop $nick $chan] ) } {             return        }        if {![file exists "reps.txt"]} {            close [open "reps.txt" w]        }        set fs [open "reps.txt"]        set data [split [read -nonewline $fs] \n]        close $fs        if {[regexp -nocase {^\S+\+\+$} $text]} {            set whom [join [lindex [split $text +] 0]]            if {[string equal -nocase "[string map {"\[" "\\\[" "\]" "\\\]" "\}" "\\\}"} $whom]" "[string map {"\[" "\\\[" "\]" "\\\]" "\}" "\\\}"} $nick]"]} {                putserv "NOTICE $nick :You can not rep yourself."                return            }            set match [lsearch $data "[string map {"\[" "\\\[" "\]" "\\\]" "\}" "\\\}"} $whom] *"]               if {$match == -1} {                if {![llength $data]} {                    set fs [open "reps.txt" w]                } else {                    set fs [open "reps.txt" a]                }                puts $fs "$whom 1"                close $fs                putserv "PRIVMSG $chan :$whom now has 1 reputation point."                return 0            } else {                set line [lindex $data $match]                set rep [lindex $line 1]                  incr rep      if {$rep == 0} {                    set lines [lreplace $data $match $match]      } else {                    set newline "$whom $rep"                    set lines [lreplace $data $match $match $newline]                }                set fs [open "reps.txt" w]                puts $fs [join $lines "\n"]                close $fs      if {$rep == 0} {                    putserv "PRIVMSG $chan :$whom now has neutral reputation points."      } elseif {$rep == -1} {                    putserv "PRIVMSG $chan :$whom now has $rep reputation point."      } else {                    putserv "PRIVMSG $chan :$whom now has $rep reputation points."      }       }        } elseif {[regexp -nocase {^\S+--$} $text]} {            set whom [join [lindex [split $text -] 0]]            set match [lsearch $data "[string map {"\[" "\\\[" "\]" "\\\]" "\}" "\\\}"} $whom] *"]            if {$match == -1} {                if {![llength $data]} {                    set fs [open "reps.txt" w]                } else {                    set fs [open "reps.txt" a]                }                puts $fs "$whom -1"                close $fs                putserv "PRIVMSG $chan :$whom now has -1 reputation point."                return            }            set line [lindex $data $match]            set rep [lindex $line 1]            incr rep -1            set newline "$whom $rep"            if {$rep == 0} {                set lines [lreplace $data $match $match]                set check 0            } elseif {$rep == 1} {                set lines [lreplace $data $match $match $newline]                set check 1            } else {                set lines [lreplace $data $match $match $newline]                set check 2          }            set fs [open "reps.txt" w]            puts $fs [join $lines "\n"]            close $fs            if {$check == 0} {                putserv "PRIVMSG $chan :$whom now has neutral reputation points."            } elseif {$check == 1} {      putserv "PRIVMSG $chan :$whom now has 1 reputation point."            } else {            putserv "PRIVMSG $chan :$whom now has $rep reputation points."       }   } elseif {[string equal "${bchar}rep" $text]} {            if {![llength $data]} {      putserv "PRIVMSG $chan :No one currently has any reputation points."                return 0       }            putserv "NOTICE $nick :   The reputation list is as follows:"            set fs [open "reps.txt"]            while {[gets $fs line] &gt;= 0} {                set rep [join [lindex [split $line] 1]]                if {$rep == 1 || $rep == -1} {                    puthelp "NOTICE $nick :[join [lindex [split $line] 0]] has $rep reputation point."                } else {                    puthelp "NOTICE $nick :[join [lindex [split $line] 0]] has $rep reputation points."                }            }            puthelp "NOTICE $nick :   End of reputation list"            close $fs        } elseif {[string match -nocase "${bchar}rep *" $text]} {            if {[llength [split $text]] != 2} {              return            }        set whom [string map {"\[" "\\\[" "\]" "\\\]" "\}" "\\\}"} [join [lindex [split $text] end]]]       regsub -all {\s} $whom ""        set line [lsearch $data "$whom *"]        if {$line != -1} {        set line [lindex $data $line]        set whom [string map {"\\\]" "\]" "\\\[" "\[" "\\\{" "\{" "\\\}" "\}"} $whom]            if {[lindex [split $line] 1] == 1 || [lindex [split $line] 1] == -1} {           putserv "PRIVMSG $chan :$whom has [lindex [split $line] 1] reputation point."            } else {           putserv "PRIVMSG $chan :$whom has [lindex [split $line] 1] reputation points."            }        } else {           putserv "PRIVMSG $chan :$whom has no reputation points"        }   }    }          return}putlog " -rep.tcl loaded"</code></pre></div><br>You can find my previous error in the line that I directed you to earlier.<br>I used || instead of &amp;&amp; as the original scripter had it.<br><br>The above has been tested - but only briefly.<br>In that it responds to the public command    !rep     if the user is either op'd or voiced.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Mon Dec 05, 2011 11:23 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LinkinPark]]></name></author>
		<updated>2011-12-05T04:50:12-04:00</updated>

		<published>2011-12-05T04:50:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98318#p98318</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98318#p98318"/>
		<title type="html"><![CDATA[Needed help with !rep]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98318#p98318"><![CDATA[
Hi willyw,<br><br>Thanks for understand .. You're right that what I meant.. sorry for my bad English.. but it still not working..<br><br>it's only work with voice'ed users to check !rep and nick++<br><br>for op'ed users can not check it..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11651">LinkinPark</a> — Mon Dec 05, 2011 4:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2011-12-04T12:03:19-04:00</updated>

		<published>2011-12-04T12:03:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98302#p98302</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98302#p98302"/>
		<title type="html"><![CDATA[Re: Needed help with !rep]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98302#p98302"><![CDATA[
<blockquote class="uncited"><div>Can anyone edit the access to use this.. I was an op'ed but can not check !rep but voiced people can do it as well..</div></blockquote>I'm not 100% sure of what you are asking.  But I think I may have the idea.<br><br>Find this line:<div class="codebox"><p>Code: </p><pre><code>if {![isvoice $nick $chan] &amp;&amp; ![matchattr $hand |o $chan]} { </code></pre></div>and change it to this:<div class="codebox"><p>Code: </p><pre><code>if {![isvoice $nick $chan] || ![isop $nick $chan]} {</code></pre></div>Rehash, and see if that does what you want.<br>I have not tested it.<br>The idea is to have it work, if the user is EITHER voiced or op'd.<br><br>Here is reference for isvoice and isop:<br><a href="http://www.eggheads.org/support/egghtml/1.6.20/tcl-commands.html" class="postlink">http://www.eggheads.org/support/egghtml ... mands.html</a><br><br><br>side note -  see this line:<div class="codebox"><p>Code: </p><pre><code>bind pubm * * rep </code></pre></div>perhaps it is ok, and works fine as-is.<br>But it seems to me that it should be:<div class="codebox"><p>Code: </p><pre><code>bind pubm - "* *" rep</code></pre></div>Again, see above link for tcl-commands.doc for reference.<br><br><br>I hope this helps.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sun Dec 04, 2011 12:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LinkinPark]]></name></author>
		<updated>2011-12-04T10:06:55-04:00</updated>

		<published>2011-12-04T10:06:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=98299#p98299</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=98299#p98299"/>
		<title type="html"><![CDATA[Needed help with !rep]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=98299#p98299"><![CDATA[
Can anyone edit the access to use this.. I was an op'ed but can not check !rep but voiced people can do it as well..<br><div class="codebox"><p>Code: </p><pre><code>## Rep.tcl-v.1.1.0## Author: Luminous## Support: pm on egghelp.org## This is a public script for voiced and opped users to add or remove reputation points to/from users. Its intended use is to keep track of positively and negatively contributing users, similar to forums with reputation systems. Points will be logged to the file "~/eggdrop/reps.txt". Note that everyone starts off at 0 or "neutral" points and does not show up as having reputation via !rep or !rep NICK until they reach negative or positive points. If points are removed from a user not in the file, they are automatically given -1. If rep is added to a user not in the file, they are automatically given 1. The plus/minus increments work normally from there unless the user reaches 0, or neutral, again.## Commands# All commands are public# To add a reputation point to a user, use "NICK++" # To remove a reputation point, use "NICK--"# To view the reputation points of a specific user, use "!rep NICK"# To view all reputation, use "!rep". A list will be noticed you slowly to avoid flooding.# Set below the char you want to trigger the "rep" functions with:set bchar "!"## Code starts, edit beyond here at your own riskbind pubm * * repproc rep {nick host hand chan text} { global bchar    if {[regexp -nocase {^\S+\+\+$} $text] || [regexp -nocase {^\S+--$} $text] || [regexp "^${bchar}rep.*" $text]} {        if {![isvoice $nick $chan] &amp;&amp; ![matchattr $hand |o $chan]} {            return        }        if {![file exists "reps.txt"]} {            close [open "reps.txt" w]        }        set fs [open "reps.txt"]        set data [split [read -nonewline $fs] \n]        close $fs        if {[regexp -nocase {^\S+\+\+$} $text]} {            set whom [join [lindex [split $text +] 0]]            if {[string equal -nocase "[string map {"\[" "\\\[" "\]" "\\\]" "\}" "\\\}"} $whom]" "[string map {"\[" "\\\[" "\]" "\\\]" "\}" "\\\}"} $nick]"]} {                putserv "NOTICE $nick :You can not rep yourself."                return            }            set match [lsearch $data "[string map {"\[" "\\\[" "\]" "\\\]" "\}" "\\\}"} $whom] *"]               if {$match == -1} {                if {![llength $data]} {                    set fs [open "reps.txt" w]                } else {                    set fs [open "reps.txt" a]                }                puts $fs "$whom 1"                close $fs                putserv "PRIVMSG $chan :$whom now has 1 reputation point."                return 0            } else {                set line [lindex $data $match]                set rep [lindex $line 1]                  incr repif {$rep == 0} {                    set lines [lreplace $data $match $match]} else {                    set newline "$whom $rep"                    set lines [lreplace $data $match $match $newline]                }                set fs [open "reps.txt" w]                puts $fs [join $lines "\n"]                close $fsif {$rep == 0} {                    putserv "PRIVMSG $chan :$whom now has neutral reputation points."} elseif {$rep == -1} {                    putserv "PRIVMSG $chan :$whom now has $rep reputation point."} else {                    putserv "PRIVMSG $chan :$whom now has $rep reputation points."}    }        } elseif {[regexp -nocase {^\S+--$} $text]} {            set whom [join [lindex [split $text -] 0]]            set match [lsearch $data "[string map {"\[" "\\\[" "\]" "\\\]" "\}" "\\\}"} $whom] *"]            if {$match == -1} {                if {![llength $data]} {                    set fs [open "reps.txt" w]                } else {                    set fs [open "reps.txt" a]                }                puts $fs "$whom -1"                close $fs                putserv "PRIVMSG $chan :$whom now has -1 reputation point."                return            }            set line [lindex $data $match]            set rep [lindex $line 1]            incr rep -1            set newline "$whom $rep"            if {$rep == 0} {                set lines [lreplace $data $match $match]                set check 0            } elseif {$rep == 1} {                set lines [lreplace $data $match $match $newline]                set check 1            } else {                set lines [lreplace $data $match $match $newline]                set check 2       }            set fs [open "reps.txt" w]            puts $fs [join $lines "\n"]            close $fs            if {$check == 0} {                putserv "PRIVMSG $chan :$whom now has neutral reputation points."            } elseif {$check == 1} {putserv "PRIVMSG $chan :$whom now has 1 reputation point."            } else {         putserv "PRIVMSG $chan :$whom now has $rep reputation points."     }} elseif {[string equal "${bchar}rep" $text]} {            if {![llength $data]} {putserv "PRIVMSG $chan :No one currently has any reputation points."                return 0    }            putserv "NOTICE $nick :   The reputation list is as follows:"            set fs [open "reps.txt"]            while {[gets $fs line] &gt;= 0} {                set rep [join [lindex [split $line] 1]]                if {$rep == 1 || $rep == -1} {                    puthelp "NOTICE $nick :[join [lindex [split $line] 0]] has $rep reputation point."                } else {                    puthelp "NOTICE $nick :[join [lindex [split $line] 0]] has $rep reputation points."                }            }            puthelp "NOTICE $nick :   End of reputation list"            close $fs        } elseif {[string match -nocase "${bchar}rep *" $text]} {            if {[llength [split $text]] != 2} {              return            }        set whom [string map {"\[" "\\\[" "\]" "\\\]" "\}" "\\\}"} [join [lindex [split $text] end]]]    regsub -all {\s} $whom ""        set line [lsearch $data "$whom *"]        if {$line != -1} {        set line [lindex $data $line]        set whom [string map {"\\\]" "\]" "\\\[" "\[" "\\\{" "\{" "\\\}" "\}"} $whom]            if {[lindex [split $line] 1] == 1 || [lindex [split $line] 1] == -1} {           putserv "PRIVMSG $chan :$whom has [lindex [split $line] 1] reputation point."            } else {           putserv "PRIVMSG $chan :$whom has [lindex [split $line] 1] reputation points."            }        } else {           putserv "PRIVMSG $chan :$whom has no reputation points"        }}    }        return}putlog " -rep.tcl loaded"</code></pre></div>Thank you for reading and helping this out..<br><br><span style="color:red">Moderated: Changed the quote-tags to code-tags. Preserves the indenting of the code, and eases readability.<br><br>/NML_375</span><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11651">LinkinPark</a> — Sun Dec 04, 2011 10:06 am</p><hr />
]]></content>
	</entry>
	</feed>
