Scripts / [Help] comparing numbers

Author
Message
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 1st May 2014 20:33 Edited at: 1st May 2014 20:57
Hi, can anyone help me figure out why this isn't working correctly please?

it's meant to be a script for a lottery / bingo type thing... basically you get 3 random numbers given which then compare to 5 random numbers

however the issue is that even matching 1 number results in a win - while i'm meant to have written it to only accept a win for all 3 being matched so obviously the
Quote: "matched = matched + 1"
isn't working correctly but i can't figure out how to change it to make it work



the script should run as is.





p.s. anyone managed to get a goto statement to work? it's meant to be



but it doesnt work

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd May 2014 07:58
Maybe put a if gkey pressed = 0 at the end just to make sure the script can't repeat itself and keep adding to matched +1

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 2nd May 2014 18:12 Edited at: 2nd May 2014 18:13
thanks it's working now, i knew it was an issue with matched being updated too many times but i had been staring at it so long yesterday i just couldnt focus... came back at it now and instantly fix it, you were kinda right except i have it running outside of the E press code (because the timer needs to run far longer than the actual key is pressed for)

but with a simple varible to stop the for loop being run again it now works

i originally was trying a "break" function thinking that would do the same but now i realise that it wouldnt.



if anyone is interested the working code is here





i'm hoping to be able to change the input system (so you can actually pick the first set of numbers yourself) next update

and i haven't worked out a way to stop repeats in the numbers yet (i was hoping to use a goto to make it restart the randoming process but goto doesnt work afaik) so for now it just randoms the repeat number once more (but doesnt check it again so it's possible that it'll be a repeat again anyway)



i will also be adding in a cost varible (hence the half price prompt) but that shouldn't be too tough to add (the tough part will be working out the right balance for cost / reward).

life's one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
AuShadow
GameGuru TGC Backer
10
Years of Service
User Offline
Joined: 2nd Dec 2013
Location: Australia
Posted: 2nd May 2014 22:48
Good to hear its working and sorry for the short reply lol might have seen it properly too but just using my phone at the moment so typings a hassle , anyway great work

PC Specs: Windows 7 home 64-bit, Amd 7900 3gb DDR5 graphics, 8gb DDR3 Ram, Intel i7 3.4ghz

Feel free to visit and edit the public FPSCR resource wiki page: http://fpscrresource.wikispaces.com/home

Login to post a reply

Server time is: 2024-05-06 05:02:32
Your offset time is: 2024-05-06 05:02:32