Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
EmilyRose
Newbie


Joined: 09 Jul 2008
Posts: 8

PostPosted: Tue Sep 22, 2009 10:56 pm   

Voter pkg for cmud - strange error
 
Code:
if not http then http = require("socket.http") end

print("Connecting to grab info...")
local page = http.request("http://www.topmudsites.com/vote-Sirene.html")
local vtid = string.match(page,'<input type="hidden" name="vtid1" value="(%x+)">')
local mudid = string.match(page,'<input type="hidden" name="mudid" value="(%d+)">')
print("Have info, voting now...")
local r, c = http.request("http://www.topmudsites.com/vote.php","vtid1=" .. vtid .. "&mudid=" .. mudid .. "&do=in")
if c == 301 then
  print("Voting successful.")
else
  print("Voting failed, error code " .. c)
end

Ok that's the code for the vote pkg I got this out of the CMUD library.
I installed the seperate LUA from here http://forums.zuggsoft.com/forums/viewtopic.php?t=32901
I'm not a coder of any sort, but it sort of worked until it gave me this error that I don't understand



Code:
Error Parsing Command:
attempt to concatenate local 'vtid' (a nil value) (line 8)

Vote

Stack trace:
[String "code"]:8:in main chunk"





I have no idea what that means, I sent a bug report and Zugg said to post it here.
Anyone have any idea what it wants? :)
Thanks!
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Wed Sep 23, 2009 12:00 am   
 
It's happening because the vtid1 is no longer a field there. Instead, it's s09id1, so changing the vtid1 to s09id1 in both instances should work. No need to change the local vtid. That's just a variable. I could be wrong, though, but it seems to work.

Charneus
Reply with quote
EmilyRose
Newbie


Joined: 09 Jul 2008
Posts: 8

PostPosted: Wed Sep 23, 2009 12:55 pm   
 
Code:
if not http then http = require("socket.http") end

print("Connecting to grab info...")
local page = http.request("http://www.topmudsites.com/vote-Sirene.html")
local vtid = string.match(page,'<input type="hidden" name="vtid1" value="(%x+)">')
local mudid = string.match(page,'<input type="hidden" name="mudid" value="(%d+)">')
print("Have info, voting now...")
local r, c = http.request("http://www.topmudsites.com/vote.php","s09id1=" .. s09id1 .. "&mudid=" .. mudid .. "&do=in")
if c == 301 then
  print("Voting successful.")
else
  print("Voting failed, error code " .. c)
end


Like that? Its producing the same stack trace error message
Reply with quote
EmilyRose
Newbie


Joined: 09 Jul 2008
Posts: 8

PostPosted: Wed Sep 23, 2009 12:58 pm   
 
changed the local to s09id1 and now it works.
Thanks!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Sep 28, 2009 1:44 am   
 
Thanks for this update; I've uploaded a new version of this script to the library that fixes the problem.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net