PenUltima Online

It is currently Fri Sep 05, 2008 11:36 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Voting script error...
PostPosted: Fri Aug 18, 2006 2:12 pm 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
I changed a few things, now i have this but the same problem.
Quote:
program vote(who, mobile);
CONST WAIT_TIME := 900;
var last_vote := CInt(GetObjProperty(mobile, "#LastVote"));
var itemtocreate:=0x204E;
var itemamount:=1;
var randomnumber:=randomint(50)+1;

if ( last_vote && (Polcore().systime - last_vote) < WAIT_TIME )
SendSysMessage(mobile, "You must wait at least 15 hours seconds before Voting again.");
return 0;
else
SetObjProperty(mobile, "#LastVote", Polcore().systime);
endif

OpenWebSite(who, "http://poison.no-ip.org/vote.php");
SendSysMessage(who, "Thanks for voting for us! .You have a 1 out of 50 chance to receive a special item.");
if (randomnumber == 7)
CreateItemInBackpack( who, itemtocreate, itemamount);
Sendsysmessage(who,"Congratz! You just won a death shroud!");
endif
endprogram




Ok well, thats my script(I didnt copy it all) but how come that doesnt set a "cprop" so thatm they can't vote 100 times in a row..?


Last edited by Poi on Sun Aug 20, 2006 6:40 am, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 1:30 am 
Offline

Joined: Fri Feb 03, 2006 6:32 am
Posts: 104
Location: Austria
a problem I see, is that polcore.systime is a counter in seconds.... as is the value "900" which thus states 15 mins and not 15 hours.
Ps: why use a temporary cprop? If your server restarts, the value will be gone... and they can vote again as well.

oh and another thing.... you have:
Code:
program vote(who, mobile);


how do you start that?
start_script will only pass 1 (!) parameter, even though you could pass an array or struct to hold multiple entries. However I know of no script-type, which would pass two mobile-references.... guess there's something wrong there. Verify your script-type. (I'd try debug the value "mobile" - e.g. using print("mobile="+mobile); and watching the console)

_________________
[url=www.etheria.org]
Etheria - Roleplaying Realism
Image [/url]


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 6:43 am 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
Well, thanks for... talking, but that had nothing to do with ym question, not to be an asshole, but i don't like to ask questions and get answers to different ones.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 8:36 am 
Offline
User avatar

Joined: Sat Feb 04, 2006 8:17 am
Posts: 137
Location: Illinois, USA
It is this type of attitude that gets people pissed off. I am looking at your code that you posted and the response by Firedancer and he is pointing you to the correct areas to research the problem for yourself.

The script as you have written will not work period! You did not even take time to look at anything that was suggested to you before spouting off in your reply either.

The biggest thing I see in your script is that you really need to learn what a script type is and how the refernces to the scripts are handled when they get called. This alone will help you learn what you are doing wrong.

_________________
2nd place is the 1st loser.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 8:59 am 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
Hey bud, my script works fine, EXCEPT that it does not stop people from running it over and over again. Like i said in the first post, I did NOT post the entire script


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 10:04 pm 
Not that you are listening, but again, Poi, FD was pointing you in exactly the right directions with everything he posted. We all understand that you didn't post the whole script... but what you posted #1, isn't at all what you think you've written, for exactly the reason FD posted and #2, might not be working at all, in any way, because of what else FD posted.

Maybe cool down a notch or two, and re-read what FD posted.

Oh.. and also... you might want to read the rules on the voting site you are on, before you settle on giving out a reward for voting. Just an FYI; One site I know you are on (no clue if you are on others) not only does not have a 15 hour time limit, but also bans sites from it for giving out prizes for voting. But hey... who are we?


Top
  
 
 Post subject:
PostPosted: Sun Aug 20, 2006 6:38 am 
Offline

Joined: Fri Apr 14, 2006 9:36 am
Posts: 240
@Marilla Ive read his post a few times now, and its not telling me anything just asking questions about stuff that is not nessessary

@FD/Marrila/Tritan, You guys should really not assume things, i was never mad.... I know its hard to tell over the internet(Besides voice chat) but i was never mad.. -.-


Also, Marilla, please tell me what voting site, i have looked at all of them, only one of them had rules i could find and it stated nothing about prizes?

Edit: ill try somehting that i think fd is pointing out, if it doesnt work then show me what fd is trying to tell me.

Edit again: It works now, thanks fd and sorry for any frustration i have caused. Maybe next time ill read more.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl