Guest User

fixed GAMBLER

a guest
Oct 31st, 2013
593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. /**
  2. * @filename Gamble.js
  3. * @author kolton
  4. * @desc keep gambling while other players supply you with gold
  5. */
  6.  
  7. function Gamble() {
  8. var gold,
  9. info = Gambling.getInfo(),
  10. needGold = false;
  11.  
  12. if (!info) {
  13. throw new Error("Bad Gambling System config.");
  14. }
  15.  
  16. me.maxgametime = 0;
  17. Town.goToTown(1);
  18.  
  19. addEventListener('copydata',
  20. function (mode, msg) {
  21. if (needGold && mode === 0 && info.goldFinders.indexOf(msg) > -1) {
  22. print("Got game request from " + msg);
  23. sendCopyData(null, msg, 4, me.gamename + "/" + me.gamepassword);
  24. }
  25. });
  26.  
  27. while (true) {
  28. if (Town.needGamble()) {
  29. Town.gamble();
  30. } else {
  31. needGold = true;
  32. }
  33.  
  34. Town.move("stash");
  35.  
  36. while (needGold) {
  37. while (true) {
  38. if (Town.needGamble()) {
  39. needGold = false;
  40. }
  41.  
  42. Town.stash();
  43.  
  44. gold = getUnit(4, 523, 3);
  45.  
  46. if (!gold || !Pickit.canPick(gold)) {
  47. break;
  48. }
  49.  
  50. Pickit.pickItem(gold);
  51. delay(500);
  52. }
  53.  
  54. delay(500);
  55. }
  56.  
  57. delay(1000);
  58. }
  59.  
  60. return true;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment