Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rng_address = 0x0205BAC2
- lucky_chance = 5 --(out of 100)
- lucky_chance_high = 6
- v_space = 9
- yorng = 55555
- function BitAND(a,b)--Bitwise and
- p,c = 1,0
- while a>0 and b>0 do
- local ra, rb = a%2, b%2
- if ra+rb > 1 then
- c = c+p
- end
- a, b, p = (a-ra)/2, (b-rb)/2, p*2
- end
- return c
- end
- function nextRNG(seed)--RNG algorithm
- return BitAND(math.floor(seed*20.5), 0x7fff) + seed%2*0x8000
- end
- function fn()
- rng = memory.readword(rng_address)--get current (most recently used) RNG
- gui.text(0, -190, rng, "red")--display current RNG
- for i = 1,20 do --for each next 20 RNG values
- rng = nextRNG(rng)-- find next RNG value
- color = ""
- if rng%100 < lucky_chance then
- color = "#FFFF00"
- elseif rng%100 < lucky_chance_high then
- color = "#FFAA00"
- end
- gui.text(0, i*v_space-190, rng, color)
- if rng == yorng then
- gui.text(69, i*v_space-190, "yoooo")
- end
- end
- end
- gui.register(fn)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement