mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-19 22:23:28 +02:00
Version 2.0 - preys, bot updates, ui improvements
This commit is contained in:
8
modules/game_bot/default_configs/examples/battle.lua
Normal file
8
modules/game_bot/default_configs/examples/battle.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
local batTab = addTab("Batt")
|
||||
|
||||
Panels.AttackSpell(batTab)
|
||||
Panels.AttackItem(batTab)
|
||||
|
||||
Panels.AttackLeaderTarget(batTab)
|
||||
Panels.LimitFloor(batTab)
|
||||
Panels.AntiPush(batTab)
|
8
modules/game_bot/default_configs/examples/cavebot.lua
Normal file
8
modules/game_bot/default_configs/examples/cavebot.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
local caveTab = addTab("Cave")
|
||||
|
||||
local waypoints = Panels.Waypoints(caveTab)
|
||||
local attacking = Panels.Attacking(caveTab)
|
||||
local looting = Panels.Looting(caveTab)
|
||||
addButton("tutorial", "Help & Tutorials", function()
|
||||
g_platform.openUrl("https://github.com/OTCv8/otclientv8_bot")
|
||||
end, caveTab)
|
5
modules/game_bot/default_configs/examples/example.otui
Normal file
5
modules/game_bot/default_configs/examples/example.otui
Normal file
@@ -0,0 +1,5 @@
|
||||
ExampleLabel2 < Label
|
||||
text: LOL
|
||||
height: 200
|
||||
width: 50
|
||||
|
16
modules/game_bot/default_configs/examples/hp.lua
Normal file
16
modules/game_bot/default_configs/examples/hp.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
local healTab = addTab("HP")
|
||||
|
||||
Panels.Haste(healTab)
|
||||
Panels.ManaShield(healTab)
|
||||
Panels.AntiParalyze(healTab)
|
||||
Panels.Health(healTab)
|
||||
Panels.Health(healTab)
|
||||
Panels.HealthItem(healTab)
|
||||
Panels.HealthItem(healTab)
|
||||
Panels.ManaItem(healTab)
|
||||
Panels.ManaItem(healTab)
|
||||
Panels.Equip(healTab)
|
||||
Panels.Equip(healTab)
|
||||
Panels.Equip(healTab)
|
||||
Panels.Eating(healTab)
|
||||
|
39
modules/game_bot/default_configs/examples/icons.lua
Normal file
39
modules/game_bot/default_configs/examples/icons.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
|
||||
addIcon("dancing", {outfit={mount=0,feet=0,legs=0,body=176,type=128,auxType=0,addons=3,head=48}, hotkey="F5", text="dance"}, macro(100, "dance", function()
|
||||
turn(math.random(0,3))
|
||||
end))
|
||||
--[[
|
||||
addIcon("ctrl", {outfit={mount=0,feet=10,legs=10,body=176,type=129,auxType=0,addons=3,head=48}, text="press ctrl to move icon"}, function(widget, enabled)
|
||||
if enabled then
|
||||
info("icon on")
|
||||
else
|
||||
info("icon off")
|
||||
end
|
||||
end)
|
||||
|
||||
addIcon("mount", {outfit={mount=848,feet=10,legs=10,body=176,type=129,auxType=0,addons=3,head=48}}, function(widget, enabled)
|
||||
if enabled then
|
||||
info("icon mount on")
|
||||
else
|
||||
info("icon mount off")
|
||||
end
|
||||
end)
|
||||
|
||||
addIcon("mount 2", {outfit={mount=849,feet=10,legs=10,body=176,type=140,auxType=0,addons=3,head=48}, switchable=false}, function(widget, enabled)
|
||||
info("icon mount 2 pressed")
|
||||
end)
|
||||
|
||||
addIcon("item", {item=3380, hotkey="F6", switchable=false}, function(widget, enabled)
|
||||
info("icon clicked")
|
||||
end)
|
||||
|
||||
addIcon("item2", {item={id=3043, count=100}, switchable=true}, function(widget, enabled)
|
||||
info("icon 2 clicked")
|
||||
end)
|
||||
|
||||
addIcon("text", {text="text\nonly\nicon", switchable=true}, function(widget, enabled)
|
||||
info("icon with text clicked")
|
||||
end)
|
||||
|
||||
]]--
|
16
modules/game_bot/default_configs/examples/main.lua
Normal file
16
modules/game_bot/default_configs/examples/main.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
Panels.TradeMessage()
|
||||
Panels.AutoStackItems()
|
||||
|
||||
addButton("discord", "Discord & Help", function()
|
||||
g_platform.openUrl("https://discord.gg/yhqBE4A")
|
||||
end)
|
||||
|
||||
addButton("forum", "Forum", function()
|
||||
g_platform.openUrl("https://otland.net/forums/otclient.494/")
|
||||
end)
|
||||
|
||||
addButton("github", "Documentation", function()
|
||||
g_platform.openUrl("https://github.com/OTCv8/otclientv8_bot")
|
||||
end)
|
||||
|
||||
addSeparator("sep")
|
7
modules/game_bot/default_configs/examples/npc.lua
Normal file
7
modules/game_bot/default_configs/examples/npc.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
singlehotkey("f10", "npc buy and sell", function()
|
||||
NPC.say("hi")
|
||||
NPC.say("trade")
|
||||
NPC.buy(3074, 2) -- wand of vortex
|
||||
NPC.sell(3074, 1)
|
||||
NPC.closeTrade()
|
||||
end)
|
84
modules/game_bot/default_configs/examples/tools.lua
Normal file
84
modules/game_bot/default_configs/examples/tools.lua
Normal file
@@ -0,0 +1,84 @@
|
||||
local toolsTab = addTab("Tools")
|
||||
|
||||
macro(1000, "exchange money", function()
|
||||
local containers = getContainers()
|
||||
for i, container in pairs(containers) do
|
||||
for j, item in ipairs(container:getItems()) do
|
||||
if item:isStackable() and (item:getId() == 3035 or item:getId() == 3031) and item:getCount() == 100 then
|
||||
g_game.use(item)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
macro(1000, "this macro does nothing", "f7", function()
|
||||
|
||||
end)
|
||||
|
||||
macro(100, "debug pathfinding", nil, function()
|
||||
for i, tile in ipairs(g_map.getTiles(posz())) do
|
||||
tile:setText("")
|
||||
end
|
||||
local path = findEveryPath(pos(), 20, {
|
||||
ignoreNonPathable = false
|
||||
})
|
||||
local total = 0
|
||||
for i, p in pairs(path) do
|
||||
local s = i:split(",")
|
||||
local pos = {x=tonumber(s[1]), y=tonumber(s[2]), z=tonumber(s[3])}
|
||||
local tile = g_map.getTile(pos)
|
||||
if tile then
|
||||
tile:setText(p[2])
|
||||
end
|
||||
total = total + 1
|
||||
end
|
||||
end)
|
||||
|
||||
macro(1000, "speed hack", nil, function()
|
||||
player:setSpeed(1000)
|
||||
end)
|
||||
|
||||
hotkey("f5", "example hotkey", function()
|
||||
info("Wow, you clicked f5 hotkey")
|
||||
end)
|
||||
|
||||
singlehotkey("ctrl+f6", "singlehotkey", function()
|
||||
info("Wow, you clicked f6 singlehotkey")
|
||||
usewith(268, player)
|
||||
end)
|
||||
|
||||
singlehotkey("ctrl+f8", "play alarm", function()
|
||||
playAlarm()
|
||||
end)
|
||||
|
||||
singlehotkey("ctrl+f9", "stop alarm", function()
|
||||
stopSound()
|
||||
end)
|
||||
|
||||
local positionLabel = addLabel("positionLabel", "")
|
||||
onPlayerPositionChange(function()
|
||||
positionLabel:setText("Pos: " .. posx() .. "," .. posy() .. "," .. posz())
|
||||
end)
|
||||
|
||||
local s = addSwitch("sdSound", "Play sound when using sd", function(widget)
|
||||
storage.sdSound = not storage.sdSound
|
||||
widget:setOn(storage.sdSound)
|
||||
end)
|
||||
s:setOn(storage.sdSound)
|
||||
|
||||
onUseWith(function(pos, itemId)
|
||||
if storage.sdSound and itemId == 3155 then
|
||||
playSound("/sounds/magnum.ogg")
|
||||
end
|
||||
end)
|
||||
|
||||
macro(100, "hide useless tiles", "", function()
|
||||
for i, tile in ipairs(g_map.getTiles(posz())) do
|
||||
if not tile:isWalkable(true) then
|
||||
tile:setFill('black')
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
addLabel("mapinfo", "You can use ctrl + plus and ctrl + minus to zoom in / zoom out map")
|
Reference in New Issue
Block a user