SRL Archive - Research & Development Lounge

Make banking eats less CPU


djborec

2011-12-28 04:48:26

As lot of you can notice ,everytime somebody use in script Bank ,it is looking ofr pixels ,which eats twice more CPU then usually.

So my idea is to remake banking functions ..
Banking fuction would have array of known color points with their positions on screen (this array would be filled just once by modifed old banking method)
Then array of integers (-1,0,1) . Inicialized by default to 0.
If somebody use banking function in script ,then first time it will detect all this points by modifed old function, then save them into array. New banking method will pick random points from this array and open the bank ,if bank screen comes up, it will save into same positions as positions of points in array of known color points positions in array of integers 1. If bank screen wont comes up it will save into same position array of integers -1 and take another position and do the same thing. If banking function will be called second time, it will just load array of intgers . Look up for 0 or 1 (it will decided by random switch whatever it is looking for) . And do the same thing again . If it will get position of 0 ,then it will load same position in array of known color position ,try if banking from this position works and if yes then change 0 into 1, if no then into -1 and pick random again. If it will get position of 1, then it will just easily open bank.

This would save up some CPU ,because it does not have to look up for bank colors everytime its called ,just for the first time.

Second thing is to remove looking up for text "e quick" etc . Just basicly everyone knows that from place where mouse clicked right to open bank and position of this box is everytime same distance ,then just make mouse move random and click onto new mousebox.

This would again save up some CPU, because the script does not have to recognise text .

Flight

2011-12-28 05:44:04

This would only apply to scripts that your player does not move and your camera never changes height or angle. What script here would lack both movement and camera shifting?

biohazard222

2011-12-28 06:18:24

what if someone was standing in front of the bank booth?
that will change the location of actions and you will end up following the guy around instead of banking …

djborec

2011-12-28 06:32:05

From: Flight
This would only apply to scripts that your player does not move and your camera never changes height or angle. What script here would lack both movement and camera shifting?


then it would have to move in same part of bank each time. howver it would be good for superheater for example

Flight

2011-12-28 06:40:49

From: djborec
then it would have to move in same part of bank each time. howver it would be good for superheater for example


Provided the super-heater does not use any camera-rotating anti bans ;) Also provided you use the super-heat at SoulWars bank only, where there are no random events.

Wattah

2012-01-01 14:24:10

I'd guess your suggestion could couse problems, while i'm actually not even fully understanding it…

However usually you have to enter your login details etc etc into the script. Why not add itemlocations on that part?

//PlaceOfItem
tab = tab 1 to 9
row = should be visible row on opening
column = 1 - (approx.) 10

Code to find the tab (click range) and colums to click / search could be included in the script, or in SMART (!) easy withdraw. (dunno if this actually is in it already… I guess not, couse then the script doesn't have to search)…

Example if the script should make yew longs.

//PlaceOfItem
tab = tab 1 to 9
row = should be visible row on opening
column = 1 - (approx.) 10

and someone has his logs in tab 6 the code could do this:

1) Search in tab 6, row x for the colour of the longs.

Or even better:

2) Should someone know the exact location it would be easier: get x from tab 6, row x, column, x (which gives a clicking range). RiDiverse does pretty much the same (exept, it fails)…

Option 1 would be awesome for scripts that require to retrieve a couple of items on random banking moments (like a fighter: att/str pot, food, pray pot etc etc).