Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.6 kB
6
Indexable
setDefaultTab("Main")

function superDash(parent)
  if not parent then
     parent = panel
   end
   local switch = g_ui.createWidget('BotSwitch', parent)
   switch:setId("superDashButton")
   switch:setText("Super Dash")
   switch:setOn(storage.superDash)
   switch.onClick = function(widget)    
     storage.superDash = not storage.superDash
     widget:setOn(storage.superDash)
   end
 
   onKeyPress(function(keys)
     if not storage.superDash then
       return
     end
     consoleModule = modules.game_console
     if (keys == "W" and not consoleModule:isChatEnabled()) or keys == "Up" then
       moveToTile = g_map.getTile({x = posx(), y = posy()-1, z = posz()})
       if moveToTile and not moveToTile:isWalkable(false) then
         moveToPos = {x = posx(), y = posy()-6, z = posz()}
         dashTile = g_map.getTile(moveToPos)
         if dashTile then
           g_game.use(dashTile:getTopThing())
         end
       end
     elseif (keys == "A" and not consoleModule:isChatEnabled()) or keys == "Left" then
       moveToTile = g_map.getTile({x = posx()-1, y = posy(), z = posz()})
       if moveToTile and not moveToTile:isWalkable(false) then
         moveToPos = {x = posx()-6, y = posy(), z = posz()}
         dashTile = g_map.getTile(moveToPos)
         if dashTile then
           g_game.use(dashTile:getTopThing())
         end
       end
     elseif (keys == "S" and not consoleModule:isChatEnabled()) or keys == "Down" then
       moveToTile = g_map.getTile({x = posx(), y = posy()+1, z = posz()})
       if moveToTile and not moveToTile:isWalkable(false) then
         moveToPos = {x = posx(), y = posy()+6, z = posz()}
         dashTile = g_map.getTile(moveToPos)
         if dashTile then
           g_game.use(dashTile:getTopThing())
         end
       end
     elseif (keys == "D" and not consoleModule:isChatEnabled()) or keys == "Right" then
       moveToTile = g_map.getTile({x = posx()+1, y = posy(), z = posz()})
       if moveToTile and not moveToTile:isWalkable(false) then
         moveToPos = {x = posx()+6, y = posy(), z = posz()}
         dashTile = g_map.getTile(moveToPos)
         if dashTile then
           g_game.use(dashTile:getTopThing())
         end
       end
     end
   end)
 end
 superDash()
 
 local firstpos = player:getPosition()
local movetoSpot = macro(500, "Move to spot", function()
    if getDistanceBetween(player:getPosition(), firstpos) >= 1 then
        autoWalk(firstpos, 100, { ignoreNonPathable = true, precision = 1 })
    end
end)