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.

good voting script?

Old posts that have not been replied to for several years.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Have you stoped and even tested it? I have and got some errors.. Debug it dude :) Also I need a voting thing and started one on my own. Here is a my current progress:

Code: Select all

# script vote.tcl
# version 0.1

# stuff
set count(none:none) 0

# binds
bind pub - !vote pub:vote

proc pub:vote {nick uhost hand chan arg} {
global count
if {[llength $arg] == 0} {
putserv "PRIVMSG $chan :To vote type: !vote <number>"
return }

# count
if {![info exists count($uhost:$chan)]} {
set count($uhost:$chan) 0 }

utimer 30 "array unset count $uhost:$chan"

if {$count($uhost:$chan) > 0} {
putserv "PRIVMSG $chan :You already voted."
return
} else {
putserv "PRIVMSG $chan :Voted: [lindex $arg 0]"
incr count($uhost:$chan)
return }
}
If you have any sugestions and/or coments or something like this let me know. Also if you spot a *bug* do the same thing. :P
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Also here can be found the current progress, if anyone is interested. :)
Once the game is over, the king and the pawn go back in the same box.
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

caesar wrote:Have you stoped and even tested it? I have and got some errors.. Debug it dude :)
me?
tested it on my windrop 1.6.13. have no debug... :roll: just wrote it in notepad and tested it on the bot. what errors did you get?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Don't remember exactly, but I remeber instead what trigered the error: when I rejoined the channel and on !vote. Anyway, if you say that is working then is working. I'm working already on mine. :P
Once the game is over, the king and the pawn go back in the same box.
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

arcane wrote: theres also somewhere missing a "$", but dont want to search it now. i corrected it in my script.
it misses in the onjoin-procedure...

anyway, version 1.1 works perfect :D and much fun with your own script ;)
Y
YoYoY0

Post by YoYoY0 »

when this is completed, please post the final TCL in english. I'd love to use it in my channel for quick surveys of what we should do next... Like nforce bot, etc etc.

thanks guys.

Oh, if you can would you please add an ability to toggle it so all ppl in the channel can contribute.

thanks again.
YoYoY0
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

YoYoY0 wrote: Oh, if you can would you please add an ability to toggle it so all ppl in the channel can contribute.
sorry, what do you mean by this? dont understand. current version allows everybody to vote and to start new votes.
User avatar
Yourname
Master
Posts: 358
Joined: Mon Sep 24, 2001 8:00 pm
Location: Toronto

Post by Yourname »

How about:

-setting the timespan in days/minutes/hours/
-dynamic answers (like arcane said) yes/no/whatever/whatever
-vote option for:
1) all users present in the channel or who come and go
2) voices on the channel
3) +g'd users added on the bot
4) ops of the channel
5) +o'd users added on the bot.

-option to have "one IP/ one vote." or "one nickname/one vote"
-option to indefinately stop a vote much before the timespan like !stopvote and also !showresults
-probably option to archive vote sessions, like vote question, when it was passed, what were the results.
-and as usual, some flood protection.
* conf option for the ability for ANY user to start a vote or channel ops or +o'd users.

Is this around yet? :)
Dormant egghead.
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

ok, maybe i should explain what my script does in english:

- setting timespan in hours or minutes (no mixing of hours and minutes, but perhaps next version)
- dynamic answers (syntax: !vote <time>|<topic>|<answer1>:<answer2>:... and so on
- vote option for all users
- reminder on join, if someone didnt already vote
- one vote per host
- the vote-starter can end the vote before time is out (!endvote)
- at the moment, anybody can start a vote
- everyone can look up current vote stats/last vote stats (syntax: !vote <without arguments>)

i'll put version 1.1 in the scripts-section. my script is german, but as i said, english version on demand.

what should make it into next version:
- limiting voting to ops, voices... (optional)
- starting a vote only for ops, voices... (optional)
- free votes: no possible answers given, people can vote for ANYTHING (e.g.: !freevote 10m|whats your favorite color? - people just vote green, red, blue and so on. result: green:1, red:2, blue:4, yellow:1)
- vote comments
- archiving vote sessions (current version, only the last session is saved temporary; lost after rehash)

not sure whether i can do all this things (still wrote just 1 tcl-script), but i'll try. today i'll start writing version 2.0 i guess :D
User avatar
Yourname
Master
Posts: 358
Joined: Mon Sep 24, 2001 8:00 pm
Location: Toronto

Post by Yourname »

How about:

#Who all can start a vote?
#
#Onchannel ops (oo)? Bot +o users(o)? Onchannel voices(v)? Bot +g users(g)? ANY users(a)?
#Prefix with a + sign if you want that option and prefix with a - sign if you dont want it.
#ALL are a must, just prefix them with the right option.
#Might as well have this as a DCC setting for individual votes

set votestarters "+oo,+o,-v,-g,-a"


#Do you want the bot to remind everyone who joins the channel that a vote is in progress?
#Might as well have this as a DCC setting for individual votes

set bot_remind "yes"

#one vote per host, or you dont really care?
#Might as well have this as a DCC setting for individual votes

set one_host "yes"

#specify path to dat file for archiving vote sessions

set path "/home/yourname/egg/files/votes.dat"



As you see, I've just given as to how I'd(we) like it. If it sounds good, Based on this one,
make it as you want.

And, please.. english is in demand for sure. :P
Dormant egghead.
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

hehe... sounds not bad :D i'll see if i can get it (just to remember: still my first script... :D)
have to figure out: how to write/read data from a file, checking for onchannel-status.
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

avote 1.1b english is now available:

http://ticky21.homeip.net/user/neverland/

theres also avote1.1 german on this site. (for those who dont want to wait for slennox to put it to downloads section :D)
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

sorry, seems i forgot navigation... just go to http://ticky21.homeip.net/user/neverland/avote/

edit: fixed it.
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

hehe, a little vote for my voting script :D

these are the features so far:
- dynamic answers
- onjoin-reminder for people who havent voted yet
- one vote per host and nick
- ending a vote by the starter and ops before time is out
- limiting to user groups (ops, halfops, voice-user in the chan)
- votes using standart-flags
- setting, who can start votes (ops, halfops, voice-users in chan)
- non-secret votes possible (the bot tells the channel who voted for what)
- free votes (no predefined answers)
- adding new answers when vote is running (by ops and the starter)
- saving of current votes and vote history in files (currently working on)
im not sure if all of these are working perfect, cant test that much (have no big chan and writing script in notepad)

what i plan to built in:
- setting, in which channels votings are possible/not possible
- limiting to user-groups on the bot
- one vote per channel (currently: one vote per bot)
- all settings can be changed in partyline
- message to all people who are marked as away
- comments
- perhaps a little message every x minutes when a vote is open
anything missing?

and btw: caesar, whats going on with your voting script? would love to see it :D
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

sorry again. my webspace provider seems to be down. i apologize.
try http://server.nova-x.net/neverland/ or download it from slennox's archive.
and for all people who wait for avote 2: im sorry, but i guess it will take some more time :( i just cant manage to write on it. seems im a bit out of mind these days... after all, its still my first script and ive got some other things to do (learning for school and things, which i get money for ;))

and.. one more question: how do 2-dimensial-arrays work in tcl?
Locked