Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var colors = [12,13,12,13,12,13,11,12,12,11,12,11,12,13,12,12,12,11,12,11,12,13,13,13,12,12,12,13,12,12,12,13,13,13,12,13,12,13,12,13,12,13,12,13,12,13,12,13,12,13,12,13,12,13,12,13,12,12,12,13,12,12,11,11,13,12,12,12,13,13,13,12,13,13,13,12,13,12,13,12,13,12,12,11,12,9,12,12,9,12,11,12,13,12,11,0,9,0,11,12,13,
- 12,12,11,9,11,9,11,12,12,12,12,13,12,13,12,13,11,12,13,13,13,12,12,12,13,12,13,12,13,12,13,12,13,13,13,12,13,11,11,13,12,12,13,11,9,6,12,6,11,12,6,9,12,9,9,12,13,12,12,11,13,9,8,0,0,8,9,12,11,12,13,12,9,6,9,12,12,12,13,12,9,8,0,8,9,9,8,0,8,9,12,13,13,13,12,13,11,13,12,12,
- 11,9,11,11,9,11,12,12,12,13,12,13,13,13,12,12,12,13,11,11,13,6,11,12,12,12,12,11,12,9,9,12,12,13,12,12,12,12,11,12,0,6,6,0,12,12,12,12,12,3,11,12,11,12,13,12,13,12,9,8,0,8,9,12,0,6,0,12,13,11,11,12,13,11,13,13,12,13,9,8,0,0,8,9,13,12,13,12,13,12,13,12,12,12,11,13,12,12,9,6,
- 6,9,6,9,6,9,6,11,9,11,9,13,12,13,12,11,12,9,8,0,0,8,9,12,11,12,3,3,12,13,12,13,11,11,12,12,11,9,11,9,11,9,8,0,8,9,12,13,12,13,12,13,12,11,12,12,13,0,6,6,0,13,13,11,13,12,13,12,13,12,13,12,13,12,13,11,6,9,6,8,8,8,6,8,8,9,6,8,11,12,12,12,13,12,11,12,9,12,12,9,
- 12,11,13,12,3,3,13,12,12,12,13,12,12,12,13,12,13,12,13,11,9,12,9,11,13,13,13,12,13,12,13,11,13,12,9,8,0,0,8,9,12,12,12,13,12,13,12,13,12,13,11,13,11,6,8,6,6,8,6,6,6,6,6,8,9,6,11,13,13,13,12,13,12,11,12,11,12,12,11,13,12,12,3,3,12,12,12,13,13,13,11,11,12,13,13,12,13,12,13,12,
- 12,12,13,12,13,12,13,12,13,12,13,12,11,9,11,12,9,12,13,12,13,12,13,12,13,12,12,12,11,12,11,9,6,8,8,6,6,6,8,8,8,8,9,9,9,12,13,12,12,12,13,12,13,12,13,12,13,13,12,12,3,9,8,0,0,8,9,13,12,13,12,13,12,13,12,13,13,13,12,13,13,13,12,12,12,13,12,12,12,12,12,12,12,13,12,13,12,13,13,13,
- 13,12,13,12,12,11,12,9,11,2,8,8,6,6,6,8,8,8,8,8,6,8,9,11,11,12,13,12,13,12,12,12,12,12,12,12,13,12,3,12,0,6,6,0,12,12,13,12,12,12,13,12,12,12,13,12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,12,13,12,12,13,12,12,13,12,12,10,13,10,12,10,9,6,8,6,6,6,6,8,8,8,8,8,9,6,
- 9,11,1,11,13,13,12,12,13,12,13,13,12,13,12,3,3,12,0,6,6,0,12,13,12,12,12,12,12,13,13,13,12,12,12,12,12,12,12,12,12,12,12,12,10,12,12,12,1,12,12,12,12,11,9,12,12,9,10,12,12,13,10,10,9,9,8,8,6,6,6,8,8,8,8,8,9,9,6,11,11,11,11,12,10,12,12,13,12,12,13,12,13,3,3,9,8,0,0,8,
- 9,12,13,12,12,13,12,12,12,13,13,12,11,11,12,12,1,1,1,11,12,11,12,12,12,12,12,10,12,12,12,9,8,0,0,8,9,10,12,12,12,10,12,10,8,8,8,6,6,6,8,8,8,6,8,8,9,11,11,1,11,11,12,12,12,13,12,13,13,12,13,13,3,12,12,12,13,13,12,12,13,12,13,12,12,12,12,1,1,1,11,1,1,1,11,1,11,1,11,1,
- 11,1,11,1,11,12,12,12,12,12,0,6,6,0,10,12,10,12,12,12,9,9,9,8,8,6,6,6,6,6,8,6,6,9,6,1,11,11,11,11,11,11,12,11,12,11,12,13,12,3,3,13,13,13,12,13,12,13,13,12,12,12,12,12,1,12,1,11,1,11,1,11,1,11,1,1,1,1,1,1,1,11,12,11,1,12,10,10,0,6,6,8,9,12,10,12,12,9,11,12,
- 9,9,6,6,8,8,8,8,6,6,9,6,11,11,1,1,11,1,11,11,9,9,11,11,12,12,13,3,3,9,12,12,13,13,13,12,12,12,12,12,12,1,1,6,11,6,6,1,1,1,11,1,11,12,1,12,1,12,1,12,1,12,12,12,12,10,9,10,12,9,12,9,10,10,10,10,9,11,12,6,9,6,8,6,6,6,8,9,6,11,12,1,12,12,12,6,12,1,1,11,
- 11,9,9,11,11,12,3,3,12,12,12,12,12,12,12,12,1,1,11,11,1,1,11,11,12,12,1,1,11,1,1,1,1,1,1,1,12,12,11,1,11,12,11,12,12,12,10,12,10,12,12,12,12,12,12,11,11,9,6,9,6,9,6,9,9,6,11,12,10,12,1,1,11,1,1,1,9,9,11,11,1,9,12,12,3,3,3,10,11,11,9,9,1,1,11,11,11,11,11,12,
- 1,0,11,11,12,9,12,11,1,12,1,12,1,12,12,12,11,12,12,12,12,11,12,11,10,10,12,12,10,11,11,11,12,9,9,11,12,10,12,9,9,6,6,12,10,12,13,12,11,12,1,1,11,11,1,11,11,1,11,3,11,3,3,3,3,11,1,1,11,11,12,12,6,11,1,11,1,1,11,11,12,1,1,12,11,1,1,12,1,12,1,12,1,11,13,12,11,12,11,12,
- 11,11,11,10,12,12,12,10,12,12,12,13,9,9,12,13,13,6,6,10,12,13,13,11,11,11,1,11,11,6,1,1,11,11,1,11,1,3,12,3,3,3,3,1,11,11,1,1,11,11,11,1,1,1,11,11,13,13,12,12,13,13,13,12,1,11,1,11,1,1,11,13,11,13,11,12,11,12,12,12,10,12,11,11,10,13,13,12,12,12,12,12,12,12,12,13,13,12,12,12,
- 12,12,10,11,11,13,13,12,11,11,1,1,1,1,11,3,11,3,3,3,3,11,1,1,11,1,12,12,1,6,6,1,13,13,1,1,11,11,12,12,13,12,1,1,1,11,1,1,11,13,11,13,12,12,12,11,11,12,12,12,12,12,12,10,11,11,13,11,11,12,12,12,12,12,12,13,13,11,11,12,12,1,1,12,12,13,13,1,11,11,1,1,11,3,3,3,3,3,3,1,
- 3,1,1,12,13,12,12,1,1,11,12,1,12,12,1,1,12,13,1,1,12,1,9,1,9,1,12,12,13,12,11,11,11,12,12,12,12,12,11,12,11,11,10,12,12,12,12,12,10,10,10,10,6,6,1,6,6,6,10,1,1,12,1,1,11,11,1,12,11,11,1,3,3,3,3,3,3,11,3,13,0,1,1,13,1,1,13,13,12,1,11,1,11,1,12,11,13,12,12,1,
- 9,1,9,1,12,11,13,11,12,12,12,11,11,11,1,11,11,12,12,12,12,11,11,12,10,12,10,10,10,10,6,6,6,6,6,10,9,12,8,1,8,11,1,1,11,11,1,1,8,3,3,3,3,3,3,11,3,1,1,12,12,13,13,13,13,1,11,12,11,1,11,1,11,1,13,12,1,12,12,13,13,11,12,11,12,1,1,11,11,12,0,1,11,1,1,11,11,11,11,12,
- 12,11,11,10,12,10,1,1,6,11,11,11,6,9,9,1,1,6,1,1,11,11,11,11,11,8,8,3,3,3,3,3,3,3,3,11,11,13,13,13,12,1,12,1,12,1,1,1,1,1,11,11,12,13,12,13,13,12,11,12,12,1,1,6,6,1,1,11,11,11,1,11,11,12,12,11,11,11,11,12,10,8,9,9,1,6,6,6,6,1,1,1,9,12,8,1,8,12,12,12,
- 6,8,8,6,6,3,3,3,3,3,3,3,3,13,13,13,12,12,12,1,12,0,1,11,1,1,11,11,1,13,12,11,13,13,1,1,1,1,6,6,11,1,12,10,0,12,11,11,11,1,11,1,11,11,12,11,12,10,8,1,1,8,8,6,11,11,6,6,9,9,9,11,11,12,12,11,11,11,6,8,8,6,6,3,3,3,3,3,3,3,3,11,11,12,12,12,12,12,1,12,
- 12,1,12,8,1,12,13,1,13,1,1,12,12,6,6,12,12,1,1,11,12,11,1,11,10,1,11,11,1,11,0,11,9,11,1,0,0,11,6,11,12,9,6,11,11,11,11,11,10,11,11,11,11,11,11,11,1,8,8,8,8,3,3,3,3,3,3,3,3,3,3,1,12,1,1,8,8,1,1,12,11,1,11,1,12,12,12,12,1,1,11,12,11,11,11,12,11,12,11,11,
- 1,11,1,1,11,11,1,11,1,9,9,0,1,1,1,6,2,7,6,6,11,10,10,10,3,3,3,11,11,11,11,11,11,11,11,1,8,1,1,3,3,3,3,3,3,3,3,10,3,10,12,0,8,9,8,9,8,1,12,13,13,13,1,1,1,1,12,11,11,11,12,12,12,12,11,11,12,12,11,1,11,1,1,1,12,1,0,1,0,9,6,9,6,8,8,6,11,11,13,3,
- 3,3,3,3,3,12,12,12,12,12,12,12,11,11,11,12,12,3,3,3,3,3,3,3,3,12,3,12,10,13,8,1,9,2,2,12,1,12,12,0,12,12,13,13,11,12,12,12,12,12,12,12,12,1,11,12,11,12,1,1,10,10,1,1,8,8,6,6,12,9,12,15,12,3,3,3,3,3,3,3,3,3,3,10,10,1,1,6,12,9,12,10,12,12,12,3,3,3,3,3,
- 3,3,3,10,3,3,3,1,1,1,8,8,2,1,12,10,0,10,0,10,12,12,12,12,12,1,1,12,10,11,1,1,1,10,1,2,9,1,11,10,11,11,10,6,9,11,12,12,6,6,3,3,13,3,3,3,13,3,3,3,13,1,8,11,11,11,6,1,6,12,9,12,12,3,3,3,3,3,3,3,3,12,3,3,3,12,0,12,0,12,1,12,9,9,1,9,6,6,6,6,
- 6,6,6,1,1,1,6,1,6,1,1,1,6,6,1,10,10,8,8,8,10,10,10,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,6,6,6,1,1,1,6,6,9,12,3,3,3,3,3,3,3,3,3,3,10,3,3,9,10,9,10,6,6,1,6,9,1,6,6,6,6,6,1,9,6,6,12,12,6,11,12,11,11,9,10,11,10,3,3,3,3,3,3,
- 3,3,13,3,3,13,3,12,13,12,3,12,3,12,3,12,3,11,6,0,6,11,11,11,11,6,6,1,9,3,3,3,3,3,3,3,3,3,3,9,3,3,3,9,0,1,6,1,6,1,6,1,1,1,10,12,10,9,12,9,12,11,12,3,3,3,3,3,3,3,3,3,12,12,12,12,3,3,3,3,12,12,12,12,12,12,12,12,12,12,13,12,13,12,12,12,12,12,12,11,
- 9,9,6,1,1,6,9,3,3,3,3,3,3,3,3,3,3,10,3,3,3,3,6,12,0,11,9,11,9,10,9,10,12,11,6,11,10,6,12,11,3,12,12,12,12,12,12,12,3,13,3,3,3,3,3,3,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,12,12,11,11,9,12,12,11,11,3,3,3,3,3,3,3,3,3,3,3,10,3,3,3,
- 3,9,10,12,3,3,3,3,3,3,3,13,3,3,3,3,12,11,12,12,12,12,12,12,12,12,12,3,3,3,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,12,13,13,10,12,12,13,13,13,12,11,11,9,12,3,3,3,3,3,3,3,3,3,3,3,3,12,3,3,3,3,3,3,12,3,12,13,13,13,13,13,3,12,3,3,12,3,11,12,12,12,12,
- 12,12,12,12,12,12,3,3,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,12,12,13,13,13,10,13,13,3,3,13,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,13,13,13,12,13,13,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,3,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,
- 13,12,12,13,10,10,12,3,3,3,3,13,13,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,12,12,12,12,12,12,12,12,12,12,12,12,11,12,12,3,3,3,3,3,12,12,13,12,13,12,12,13,11,11,12,12,12,11,11,12,12,12,13,13,13,13,12,12,12,10,12,13,13,13,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,12,12,3,11,12,11,12,11,12,12,12,12,11,12,3,12,12,12,13,12,12,13,12,12,12,13,11,13,13,13,11,13,13,13,11,13,13,13,11,11,11,13,11,10,10,12,13,13,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,12,3,13,11,12,
- 11,12,11,3,3,3,3,11,10,13,12,12,12,12,12,12,12,13,12,12,12,13,11,13,13,13,11,13,13,13,11,13,13,13,12,12,13,12,10,10,12,10,3,3,3,10,3,10,10,12,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,12,3,3,3,3,3,12,3,12,3,3,3,11,11,11,3,12,12,12,12,12,12,12,12,12,12,12,11,
- 11,12,12,13,12,13,13,12,11,11,12,12,12,12,11,11,12,11,11,10,12,10,3,10,3,10,10,12,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,3,3,3,12,12,12,12,3,12,13,3,3,11,12,3,3,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,11,11,13,12,13,13,12,13,13,12,13,12,13,12,13,12,12,3,10,
- 3,10,3,10,10,12,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,3,3,3,13,12,12,12,6,13,6,11,11,11,11,11,11,3,11,3,12,12,11,11,11,12,11,11,12,12,11,11,12,12,11,12,11,11,13,12,13,13,13,13,12,13,12,13,12,13,3,3,12,3,3,12,10,10,12,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,13,3,13,13,13,13,11,3,11,3,11,11,3,11,11,3,3,2,13,3,3,13,13,3,3,13,13,3,3,13,13,11,12,11,11,13,13,12,13,13,13,3,3,3,3,12,3,3,3,13,10,10,12,12,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,3,3,3,13,13,11,3,11,12,12,12,3,12,
- 3,3,3,3,3,13,13,3,3,12,13,3,13,12,13,12,13,12,13,13,13,13,13,12,13,12,13,13,13,13,13,13,3,3,3,13,13,10,10,12,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,3,3,12,3,13,13,3,3,3,3,3,13,11,11,11,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,13,13,13,13,12,
- 13,13,11,12,13,12,12,12,10,13,3,13,3,13,13,3,3,12,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,3,3,3,3,3,3,12,13,13,3,13,11,11,13,3,3,6,3,11,12,3,3,3,12,12,12,12,12,12,12,12,12,12,3,13,13,12,12,13,12,12,6,12,12,12,12,10,10,13,10,13,3,3,12,10,10,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,12,12,12,12,12,12,12,3,6,11,3,11,12,3,3,12,12,12,12,12,12,12,12,12,12,12,3,3,13,13,3,12,13,11,12,13,6,12,6,3,3,3,10,10,3,3,3,10,3,10,3,3,3,10,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,12,12,12,12,12,12,12,3,3,3,3,3,3,3,12,12,12,13,12,13,12,13,12,12,12,3,12,11,12,11,3,12,12,13,13,13,13,13,3,3,3,7,3,3,3,10,3,10,3,10,3,10,3,10,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,10,12,10,10,10,12,12,13,13,10,13,10,13,10,13,13,13,13,13,13,
- 13,13,13,13,3,3,3,3,3,3,12,12,12,12,12,13,13,3,3,3,3,13,13,13,3,3,10,3,10,3,3,10,3,10,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,] ;
- var colorsABGR = [];
- var babaevski = {
- x: 312, /*Bottom left corner X*/
- y: 984, /*Bottom left corner Y*/
- width: 78, /*WIDTH OF IMAGE*/
- height: 62 /*HEIGHT OF IMAGE*/
- };
- var perfect_timeout = 60;
- // hooks
- var client;
- var canvasse;
- var jQuery;
- var currentDrawPosition = 0;
- var currentLoop = 0;
- r.placeModule("babaevski", function(e){
- client = e("client");
- canvasse = e("canvasse");
- jQuery = e("jQuery");
- for(var i=0; i<client.palette.length; i++){
- colorsABGR[i] = client.getPaletteColorABGR(i);
- }
- attempt();
- });
- function attempt(){
- console.log("tried to draw");
- var toWait = client.getCooldownTimeRemaining();
- if(toWait === 0)
- {
- tryDrawPixel();
- }
- else
- {
- setTimeout(attempt, toWait + Math.round(Math.random() * 1500));
- console.log("set a timeout");
- }
- }
- function tryDrawPixel()
- {
- var toWait = client.getCooldownTimeRemaining();
- if(toWait === 0 && currentLoop < babaevski.width*babaevski.height)
- {
- currentLoop++;
- console.log("checking pixel " + currentDrawPosition);
- var targetPoint = getPoint(currentDrawPosition);
- $.get( "/api/place/pixel.json", { x:targetPoint.x, y:targetPoint.y }, function( data )
- {
- setTimeout(function() {
- //wait an extra half second for reddits servers
- console.log("x" + targetPoint.x + " y"+ targetPoint.y);
- if (data.color == undefined)
- data.color = 0;
- canvasse.drawTileAt(data.x, data.y, colorsABGR[data.color]);
- if (colors[currentDrawPosition] != data.color && colors[currentDrawPosition] !== -1)
- {
- client.setColor(colors[currentDrawPosition]);
- client.drawTile(targetPoint.x, targetPoint.y);
- console.log("drew pixel at " + targetPoint.x + "/" + targetPoint.y);
- var toWait = client.getCooldownTimeRemaining();
- setTimeout(attempt, toWait + Math.round(Math.random() * 1500));
- currentLoop = 0;
- console.log("set a timeout");
- }
- else
- {
- var positionIncrease = Math.floor(Math.random() * (Math.min(0.2*currentLoop, 40))) + 1;
- currentDrawPosition += positionIncrease;
- //console.log("" + currentLoop + ", " +positionIncrease);
- if (currentDrawPosition >= babaevski.width*babaevski.height)
- currentDrawPosition = 0;
- tryDrawPixel(currentDrawPosition);
- }
- }, 100);
- });
- }
- else
- {
- var added_timeout = 0;
- if (currentLoop == babaevski.width*babaevski.height)
- added_timeout = perfect_timeout*1000;
- setTimeout(attempt, toWait + Math.round(Math.random() * 1500) + added_timeout);
- currentLoop = 0;
- console.log("set a timeout");
- }
- }
- function drawTestRTC(){
- for(var i=0; i < babaevski.width*babaevski.height; i++){
- if(colors[i] === -1){
- continue;
- }
- var targetPoint = getPoint(i);
- canvasse.drawTileAt(targetPoint.x, targetPoint.y, colorsABGR[colors[i]]);
- }
- }
- function getPoint(i){
- var x = i % babaevski.width;
- return {
- x: babaevski.x + x,
- y: babaevski.y + (i - x) / babaevski.width - babaevski.height
- };
- }
- function getPixel(x, y){
- return canvasse.writeBuffer[canvasse.getIndexFromCoords(x, y)];
- }
- //Updated by haydnG (hayhay)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement