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

	<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>2009-07-02T06:17:15-04:00</updated>

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

		<entry>
		<author><name><![CDATA[unudoitrei]]></name></author>
		<updated>2009-07-02T06:17:15-04:00</updated>

		<published>2009-07-02T06:17:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89398#p89398</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89398#p89398"/>
		<title type="html"><![CDATA[aVote 1.1b eng by arcane - please help me out]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89398#p89398"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>#####################################################       aVote 1.1b eng by arcane (arc-76024@web.de)#              (#k13, #Prophecy @euIRC)## (english translation. original script is in german)## Voting script with user-defined answers## If you decide to use my script, i'd be happy about a short message. :)## For help:#   /msg &lt;botnick&gt; vhelp##   The syntax is: "!vote &lt;time&gt;|&lt;topic&gt;|&lt;answers&gt;" (separated by "|").#     The different possible answers are separeted by ":".#     e.g. "!vote 10m|What's your favourite color? Or don't you have one?|have none:green:red:yellow:blue"##   The time is given in the following way:#     xxm: xx minutes; xxh: xx hours. No mixing of minutes and hours.#     e.g. "12m" for 12 minutes, "24h" for 24 hours. "24h 30m" is not allowed.#   #   Other commands:#     "!vote" (without arguments): shows information about current / last vote#     you vote with "/msg &lt;botnick&gt; vote &lt;answer&gt;"#     The vote-starter can end the vote using "!endvote" before time's out### Features:## - self-defined answers# - notice when joining the channel for all people who haven't voted yet# - hostmasks for voters (only one vote per host)# - no voting using bots# - ending a vote by the starter## ToDo:## - multiple sessions at the same time# - reminder for people who are away# - comments?# - limiting to user groups (all users, voice-users, ops)# - free votes (no predefined answers)## History:## - Version 1.0:  (10.02.2003)#   - published only on forum.egghelp.org#   - first version#   - published only in german# - Version 1.1:  (19.02.2003)#   - fixed some minor things (thanks to stdragon)#   - current vote stats are showed on "!vote" and onjoin#   - changed syntax to "!vote &lt;time&gt;|&lt;topic&gt;|&lt;answers&gt;"#   - some optical things#   - english translation available# - Version 1.1b: (24.02.2003)#   - fixed one small bug in the onjoin-procedure### Thanks to:## - Loki` for his Channel Voter Script 1.15# - ppslim @forum.egghelp.org for his help# - stdragon @forum.egghelp.org for looking through my script######################################################################### Params #######################set aversion "aVote 1.1b eng"set vvotes "0"##################### Bindings #####################bind pub - !vote avote_anyvotebind msg - vhelp avote_helpbind msg - vote avote_votebind pub - !endvote avote_endbind join - * avote_reminder##################### Remove old timers ############if {![info exists vtopic]} {catch {killutimer $vtimer}}##################### AnyVote ######################proc avote_anyvote {nick mask hand chan arg} {global botnick vchan vnick vpeople vvotes vtopic vanswers vcount vtime aversion vtimestart vtimer vhandif {$arg == ""} {if {$vvotes == "0"} {puthelp "NOTICE $nick :No open vote."if {[info exists vtopic]} {puthelp "NOTICE $nick :Last vote by $vnick:"puthelp "NOTICE $nick :\"$vtopic\""puthelp "NOTICE $nick :Results:"for {set number 0} {$number &lt; [llength $vanswers]} {incr number} {puthelp "NOTICE $nick :\"[lindex $vanswers $number]\": [lindex $vcount $number]"}} else {puthelp "NOTICE $nick :No votes started yet."}return 0} else {puthelp "NOTICE $nick :Current vote by $vnick:"puthelp "NOTICE $nick :\"$vtopic\""puthelp "NOTICE $nick :Current stats:"for {set number 0} {$number &lt; [llength $vanswers]} {incr number} {puthelp "NOTICE $nick :\"[lindex $vanswers $number]\": [lindex $vcount $number]"}puthelp "NOTICE $nick :Time remaining: [duration [expr (([unixtime] - $vtimestart) - $vtime) * -1]]"puthelp "NOTICE $nick :Vote with \"/msg $botnick vote &lt;answer&gt;\""return 0}} else { if {$vvotes != 0} {puthelp "NOTICE $nick :There is already a vote open."return 0}set parts [split $arg "|"] set time [lindex $parts 0] set topic [lindex $parts 1] set answers [split [lindex $parts 2] :]if {$time == "" || $topic == "" || [lindex $answers 0] == ""} {puthelp "NOTICE $nick :The syntax is \"!vote &lt;time&gt;|&lt;topic&gt;|&lt;answers&gt;\" (separated by \"|\")."puthelp "NOTICE $nick :The different possible answers are separeted by \":\"."return 0}if {[lindex $answers 1] == ""} {puthelp "NOTICE $nick :You need at least 2 possible answers."return 0}set vtimeleft $timeif [string match "*m" [string tolower $vtimeleft]] {set vtime [expr [string trimright $vtimeleft m] * 60]set vtimestart [unixtime]} elseif [string match "*h" [string tolower $vtimeleft]] {set vtime [expr [string trimright $vtimeleft h] * 3600]set vtimestart [unixtime]} else {puthelp "NOTICE $nick :$time: Wrong time format (m: minutes, h: hours)."return 0}set vchan $chanset vtopic $topicset vanswers $answersset vvotes "1"set vnick $nickset vhand $handset vcount [list] foreach answer $vanswers { lappend vcount 0 }puthelp "PRIVMSG $vchan :\002Vote by $nick:"puthelp "PRIVMSG $vchan :\"$vtopic\""puthelp "PRIVMSG $vchan :possible answers: [join $vanswers " : "]"puthelp "PRIVMSG $vchan :Time: $time"puthelp "PRIVMSG $vchan :Vote with \"/msg $botnick vote &lt;answer&gt;\""if {[info exists vpeople]} { unset vpeople }set vtimer [utimer $vtime "avote_end \"end of time\" 2 3 4 5"]}}##################### Vote #########################proc avote_vote {nick mask hand arg} {global botnick vchan vpeople vvotes vanswers vcountif {$vvotes == 0} {puthelp "NOTICE $nick :No open vote."return 0}set mask [maskhost $mask]if {[matchattr $hand b]} {puthelp "NOTICE $nick :Keine Bots."puthelp "PRIVMSG $vchan :Someone tries to vote using $nick!"return 0} elseif {[info exists vpeople($mask)]} {puthelp "NOTICE $nick :You have already voted."return 0} else {for {set number 0} {$number &lt; [llength $vanswers]} {incr number} {if {[string tolower $arg] == [string tolower [lindex $vanswers $number]]} {puthelp "NOTICE $nick :Your vote has been counted ([string tolower $arg])."set vtemp [lindex $vcount $number]incr vtempset vcount [lreplace $vcount $number $number $vtemp]set vpeople($mask) 1return 0}}puthelp "NOTICE $nick :$arg: No possible Answer."puthelp "NOTICE $nick :Possible answers are: [join $vanswers " : "]"}}##################### Help #########################proc avote_help {nick mask hand arg} {global botnick aversionputhelp "NOTICE $nick :$aversion by arcane - help"puthelp "NOTICE $nick :the syntax is \"!vote &lt;time&gt;|&lt;topic&gt;|&lt;answers&gt;\" (separated by \"|\")."puthelp "NOTICE $nick :The different possible answers are separeted by \":\"."puthelp "NOTICE $nick :The time is given in the following way:"puthelp "NOTICE $nick :xxm: xx minutes; xxh: xx hours. No mixing of minutes and hours."puthelp "NOTICE $nick :Other commands:"puthelp "NOTICE $nick :/msg $botnick vhelp: shows this help"puthelp "NOTICE $nick :!vote (without arguments): shows information about current / last vote"puthelp "NOTICE $nick :You vote with /msg $botnick vote &lt;answer&gt;"puthelp "NOTICE $nick :The vote-starter can end the vote using !endvote before time's out."}##################### Endvote ######################proc avote_end {nick mask hand chan arg} {global botnick vchan vnick vpeople vvotes vtopic vanswers vcount vtime vtimer vhand vtimestartif {$vvotes == 0} {puthelp "NOTICE $nick :No open vote."return 0}if {$chan == $vchan || $nick == "end of time"} {if {$hand != $vhand &amp;&amp; $nick != "end of time"} {puthelp "NOTICE $nick :Only the vote-starter can end the vote before time's out."return 0}if {$nick == "end of time"} {puthelp "PRIVMSG $vchan :Vote by $vnick about $vtopic ended (time out)."} else {puthelp "PRIVMSG $vchan :Vote by $vnick about $vtopic ended by $nick."}puthelp "PRIVMSG $vchan :Result:"for {set number 0} {$number &lt; [llength $vanswers]} {incr number} {puthelp "PRIVMSG $vchan :\"[lindex $vanswers $number]\": [lindex $vcount $number]"}set vvotes "0"catch {killutimer $vtimer}if {[info exists vpeople]} { unset vpeople }}}##################### OnJoin Reminder ##############proc avote_reminder {nick mask hand chan} {global botnick vchan vnick vpeople vvotes vtopic vanswers vcount vtime vtimestartif {![info exists vchan]} {return 0}set mask [maskhost $mask]if {$chan == $vchan &amp;&amp; [info exists vpeople($mask)] == 0 &amp;&amp; $vvotes != 0} {puthelp "NOTICE $nick :Current vote by $vnick"puthelp "NOTICE $nick :\"$vtopic\""puthelp "NOTICE $nick :Current Stats:"for {set number 0} {$number &lt; [llength $vanswers]} {incr number} {puthelp "NOTICE $nick :\"[lindex $vanswers $number]\": [lindex $vcount $number]"}puthelp "NOTICE $nick :Time remaining: [duration [expr (([unixtime] - $vtimestart) - $vtime) * -1]]"puthelp "NOTICE $nick :Vote with \"/msg $botnick vote &lt;answer&gt;\""}}##################### Log Message ##################putlog "\0033$aversion loaded"</code></pre></div>I need to make some modification in the script file, maybe you can help me out. <br><br>- all the voting to be done by channel command and not by /msg command<br>- all the messages from the egg to be sent on the channel not via notice to user<br>- It's possible to change the code so I can vote like this: '!vote A or B 10 m' ?<br><br>Thank you !<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10735">unudoitrei</a> — Thu Jul 02, 2009 6:17 am</p><hr />
]]></content>
	</entry>
	</feed>
