Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.64 KB | None | 0 0
  1. -- DO NOT EDIT ANYTHING BELOW
  2. local TIME = 0
  3. local firstRun = false
  4. local randTime = math.random(1, 520)*1000
  5. init end
  6.  
  7.  
  8. auto(5000, 20000)
  9. if ((not firstRun) or ($timems > TIME + randtime + 1000*60*31)) and sstime() > 60*10 then
  10. local firstChar = true
  11. for _, ACC in ipairs(accounts) do
  12. for index, accChar in ipairs(ACC.charList) do
  13.  
  14. -- Connect char
  15. while not $connected do
  16. connect(ACC.accNr, ACC.pw, accChar)
  17. wait(1000)
  18. end
  19.  
  20. local bpFound, bpNotFull = false, false
  21. while windowcount() < 2 do
  22. if windowcount() > 0 then
  23. closewindows()
  24. wait(1000, 1200)
  25. end
  26.  
  27. -- Opening main bp
  28. local mainbp = itemname($back.id)
  29. while windowcount() == 0 do
  30. openitem(0, 'back')
  31. wait(500, 700)
  32. end
  33.  
  34. -- Opening 2nd container
  35. for i=1, getcontainer(0).itemcount do
  36. if itemproperty(getcontainer(0).item[i].id, ITEM_CONTAINER) then
  37. bpFound = true
  38. while windowcount() < 2 and windowcount(mainbp) > 0 do
  39. openitem(getcontainer(0).item[i].id, 0, true)
  40. wait(1000)
  41. end
  42. end
  43. end
  44. if not bpFound then
  45. break
  46. end
  47. end
  48.  
  49. if bpFound then
  50. if getcontainer(1).emptycount > 0 then
  51. bpNotFull = true
  52. else
  53. while (true) do
  54. local isContainerInside = false
  55. for i=1, getcontainer(1).itemcount do
  56. if not bpNotFull then
  57. if itemproperty(getcontainer(1).item[i].id, ITEM_CONTAINER) then
  58. isContainerInside = true
  59. openitem(getcontainer(1).item[i].id, 1, false)
  60. wait(200, 300)
  61. if getcontainer(1).emptycount > 0 then
  62. bpNotFull = true
  63. break
  64. else
  65. i = 0
  66. end
  67. end
  68. end
  69. end
  70. if bpNotFull or not isContainerInside then
  71. break
  72. end
  73. end
  74. end
  75. end
  76.  
  77. if not bpFound or not bpNotFull then
  78. if not bpFound then
  79. printerror("Character " .. accChar .. " dont have any container inside main bp, removed from the character list.")
  80. table.remove(ACC.charList, index)
  81. elseif not bpNotFull then
  82. printerror("Character " .. accChar .. " used all slots in second container, removed from the character list.")
  83. table.remove(ACC.charList, index)
  84. end
  85.  
  86. while $connected do
  87. logout()
  88. wait(1000)
  89. end
  90. press('[ESC]')
  91. wait(1000, 1500)
  92. else
  93. if (math.abs($posx - 33502) + math.abs($posy - 32545)) > 1 then
  94. reachlocation(33502, 32545, 7)
  95. wait(500)
  96. end
  97.  
  98. local tempCap, tries = $cap, 0
  99. while $cap == tempCap and $cap > 1 and tries < 3 do
  100. useitem(15055, 33502, 32545, 7)
  101. wait(200, 300)
  102. tries = tries + 1
  103. end
  104.  
  105. if tempCap ~= $cap then
  106. increaseamountlooted(20057, 1)
  107. end
  108.  
  109. while itemcount(20057, 0) > 0 and getcontainer(1).emptycount > 0 do
  110. moveitems(20057, 1, 0, 1)
  111. wait(500)
  112. end
  113.  
  114. while $connected do
  115. logout()
  116. wait(1000)
  117. end
  118.  
  119. press('[ESC]')
  120. wait(1000, 1500)
  121. end
  122. end
  123. if firstChar then
  124. TIME, randtime, firstRun = $timems, math.random(1, 20)*1000, true
  125. firstChar = false
  126. end
  127. end
  128. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement