footballjds
2012-11-26 16:09:06
tl;dr
Place a wait(10) or greater inside EVERY loop in which you're waiting for something to happen/change.
this is to everyone out there. Please put some waits in your loops that WAIT for something!!!!
IE.
repeat
blah blah
until FindThis;
you're waiting for something in that loop so you should be waiting!!! wait at least 10-50 ms…
If you're waiting for your inv count to change use a wait in the loop!!! if you're checking something and you have no wait you'll use 100% of the processor! it looks like lag but really it POOR coding….
pretty much, the ONLY loop that doesn't require a wait is a for loop that's going through an array…(there's other exceptions, but as a rule of thumb, if you're waiting for something use a wait in your loop or else it'l devour people's processors)
EDIT:
Just an FYI, I see this poor coding habit in srl members scripts just as often as jr's and below. This isn't really a rage thread as much as a notice to all programmers. However i do kinda rage when I see my char freeze for 4 seconds because of a loop with no wait. For scripters, if your CPU is more powerful the lag will be less/minimal but if someone's computer is simply mediocre they'll suffer more.
Place a wait(10) or greater inside EVERY loop in which you're waiting for something to happen/change.
this is to everyone out there. Please put some waits in your loops that WAIT for something!!!!
IE.
repeat
blah blah
until FindThis;
you're waiting for something in that loop so you should be waiting!!! wait at least 10-50 ms…
If you're waiting for your inv count to change use a wait in the loop!!! if you're checking something and you have no wait you'll use 100% of the processor! it looks like lag but really it POOR coding….
pretty much, the ONLY loop that doesn't require a wait is a for loop that's going through an array…(there's other exceptions, but as a rule of thumb, if you're waiting for something use a wait in your loop or else it'l devour people's processors)
EDIT:
Just an FYI, I see this poor coding habit in srl members scripts just as often as jr's and below. This isn't really a rage thread as much as a notice to all programmers. However i do kinda rage when I see my char freeze for 4 seconds because of a loop with no wait. For scripters, if your CPU is more powerful the lag will be less/minimal but if someone's computer is simply mediocre they'll suffer more.