Voting script error...

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Voting script error...

Post by Poi »

I changed a few things, now i have this but the same problem.
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.
Firedancer
Grandmaster Poster
Posts: 104
Joined: Fri Feb 03, 2006 6:32 am

Post by Firedancer »

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: Select all

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)
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

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.
User avatar
Tritan
Grandmaster Poster
Posts: 147
Joined: Sat Feb 04, 2006 8:17 am

Post by Tritan »

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.
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

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
Marilla

Post by Marilla »

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?
Poi
Grandmaster Poster
Posts: 298
Joined: Fri Apr 14, 2006 9:36 am

Post by Poi »

@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.
Post Reply