Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.55 KB | None | 0 0
  1. init start
  2. -- local SCRIPT_VERSION = "3.0.0"
  3.  
  4. local ignoreServerSavingTime = false
  5. local reopenVisibleBackpacks = true
  6.  
  7. local accountsInformation = {
  8. {
  9. accountName = "accountname",
  10. accountPassword = "password",
  11. characters = {"charname"}
  12. },
  13. {
  14. accountName = "accountName2",
  15. accountPassword = "accountpassword2",
  16. characters = {"Lord\'Paulistinha", "Crisne"}
  17. },
  18. }
  19.  
  20. local specialChecks = {
  21. {
  22. function()
  23. return isontemple()
  24. end,
  25. function()
  26. printerrorf("AutoReconnect: [%q] Client closed. Reason: Character was inside a temple.", $name)
  27. closeclient(true)
  28. end
  29. },
  30. {
  31. function()
  32. return ($self.skull == SKULL_RED or $self.skull == SKULL_BLACK) and $pzone
  33. end,
  34. function()
  35. printerrorf("AutoReconnect: [%q] Client closed. Reason: Character was red/black skulled inside a protection zone.", $name)
  36. closeclient(true)
  37. end
  38. },
  39. {
  40. function()
  41. return $stamina <= 840 and $pzone
  42. end,
  43. function()
  44. printerrorf("AutoReconnect: [%q] Client closed. Reason: Character had less/equal than 14 hours of stamina and inside a protection zone.", $name)
  45. closeclient(true)
  46. end
  47. },
  48. }
  49.  
  50. -- DO NOT EDIT BELOW --
  51. if autoReconnecter == nil then
  52. autoReconnecter = {
  53. enabled = true
  54. }
  55.  
  56. autoReconnecter.isEnabled = function()
  57. return autoReconnecter.enabled
  58. end
  59.  
  60. autoReconnecter.pause = function()
  61. autoReconnecter.enabled = false
  62. end
  63.  
  64. autoReconnecter.resume = function()
  65. autoReconnecter.enabled = true
  66. end
  67. end
  68.  
  69. for _, accountEntry in pairs(accountsInformation) do
  70. table.lower(accountEntry.characters)
  71. end
  72.  
  73. local randTimeSS = math.random(100, 700)
  74.  
  75. init end
  76.  
  77. auto(1000, 2000)
  78.  
  79. local currentServerSaveTime = sstime()
  80.  
  81. if autoReconnecter.enabled and (not $connected) and (ignoreServerSavingTime or (currentServerSaveTime >= 600 + randTimeSS and currentServerSaveTime <= 85800 - randTimeSS)) then
  82. if $name ~= "" then
  83. local index = 0
  84.  
  85. for i, accountEntry in pairs(accountsInformation) do
  86. if table.find(accountEntry.characters, $name:lower()) then
  87. index = i
  88. break
  89. end
  90. end
  91.  
  92. if index > 0 then
  93. local login = accountsInformation[index]
  94. local oldTypeTimeSettings = get('Settings/TypeWaitTime')
  95. local oldPressTimeSettings = get('Settings/PressWaitTime')
  96.  
  97. set('Settings/TypeWaitTime', '110 x 140')
  98. set('Settings/PressWaitTime', '100 x 250')
  99. setlifetime(20000)
  100.  
  101. while (not $connected) do
  102. connect(login.accountName, login.accountPassword, $name) wait(200)
  103. end
  104.  
  105. set('Settings/TypeWaitTime', oldTypeTimeSettings)
  106. set('Settings/PressWaitTime', oldPressTimeSettings)
  107.  
  108. for _, checkCallback in pairs(specialChecks) do
  109. if checkCallback[1]() then
  110. checkCallback[2]()
  111. end
  112. end
  113.  
  114. if reopenVisibleBackpacks then
  115. local oldOpenNextBpSettings = get('Looting/OpenNextBP')
  116. local oldFocusPolicySettings = get('Settings/FocusPolicy')
  117. local oldOpenBpsAtLoginSettings = get('Looting/OpenBPsAtLogin')
  118.  
  119. set('Looting/OpenBPsAtLogin', 'no')
  120. set('Settings/FocusPolicy', 'Focus on any event')
  121. set('Looting/OpenNextBP', 'no')
  122. setlifetime(10000)
  123. reopenwindows('small')
  124.  
  125. while $openingbps do
  126. wait(500) pausewalking(500)
  127. end
  128.  
  129. pausewalking(0)
  130. set('Looting/OpenNextBP', oldOpenNextBpSettings)
  131. set('Settings/FocusPolicy', oldFocusPolicySettings)
  132. set('Looting/OpenBPsAtLogin', oldOpenBpsAtLoginSettings)
  133. end
  134. else
  135. printerrorf("AutoReconnect: Account details for %q doesn't exist.", $name)
  136. end
  137. else
  138. printerrorf("AutoReconnect: Please login first to save your credentials.")
  139. end
  140. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement