@verb #3028:"www_do_vote" this none this rxdo #55 @program #3028:"www_do_vote" this none this if (!player:isa($webber) || !(caller in {$www, this, this.owner})) raise(E_PERM) endif votes = 0 for q in [1..length(this.questions)] a = $www:parse_post(tostr("q", q)) if (a != E_PROPNF) if (player.user in this.questions[q][3] && (cookie = $www:parse_post(tostr("qcookie", q)))) eaten = 0 for i in [1..length(this.questions[q][2])] if (cookie in this.questions[q][2][i][2]) this.questions[q][2][i][2] = setremove(this.questions[q][2][i][2], cookie) this.questions[q][3] = setremove(this.questions[q][3], player.user) this:update_tally() player:tell("

I ate your cookie!

") eaten = 1 break endif endfor if (!eaten) player:tell("

Cookie not found! Perhaps it was mistyped or badly formed?

") endif endif if (!(player.user == $no_one || player.user in this.questions[q][3] || player.user.first_connect_time > time() - 30 * 24 * 60 * 60)) votes = votes + 1 this.questions[q][3] = $list_utils:randomly_permute({@this.questions[q][3], player.user}) vote_cookie = $wiz_utils:random_password(6) this.questions[q][2][toint(a[2..$])][2] = {@this.questions[q][2][toint(a[2..$])][2], vote_cookie} player:tell("

For the question of '", this.questions[q][1], "', your vote cookie is '", vote_cookie, "'. Remeber this, but keep it secret! You need your vote cookie if you ever want to change your vote! It's the only way we can know what you voted for.

") endif endif endfor prepstr = "" if (votes) player:tell("Your ", votes == 1 ? "vote has" | "votes have", " been recorded.") endif this:tell_www_body() "Last modified by Dax (#789) on Tue May 3 14:12:31 2005 MDT." .