and wanted to ask if this code exists in "MM2"
Code: Select all
getExecutionPath()
Code: Select all
getExecutionPath()
Code: Select all
table.copy(settings_default);
Code: Select all
table.copy(table tab)
Actually does a full copy of a table, instead of referencing the original. This also recursively copies sub-tables.
I don't understand. Do you still need help with it or not? What are you trying to accomplish?Lamkefyned wrote:I've spent a couple of hours but correcting code and come to this code and did not find the solution because the solution is the same ...
said it took 2 hours working and looking a little Rombot code but can not find the code in your wiki:Administrator wrote: I don't understand.
Code: Select all
table.copy(settings_default);
Code: Select all
---===LOGS ===---
2014-09-08 18:55:37 : MicroMacro version 1.9.17.256 (Alpha)
2014-09-08 18:55:37 : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz @2500MHz, Windows 7
2014-09-08 18:55:37 : User privilege: Administrator
-------------------------------------------------------------------------------
2014-09-08 18:55:42 : Load file error code: 7 (Runtime error)
bot.lua:40: functions.lua:2: settings.lua:175: Wrong number of parameters supplied to copy().
Code: Select all
settings_default = {
hotkeys = {
MOVE_FORWARD = {key = _G.key.VK_W, modifier = nil},
MOVE_BACKWARD = {key = _G.key.VK_S, modifier = nil},
ROTATE_LEFT = {key = _G.key.VK_Q, modifier = nil},
ROTATE_RIGHT = {key = _G.key.VK_E, modifier = nil},
STRAFF_LEFT = {key = _G.key.VK_A, modifier = nil},
STRAFF_RIGHT = {key = _G.key.VK_D, modifier = nil},
JUMP = {key = _G.key.VK_SPACE, modifier = nil},
TARGET = {key = _G.key.VK_TAB, modifier = nil},
TARGET_FRIEND = {key = _G.key.J, modifier = nil},
ESCAPE = {key = _G.key.VK_ESCAPE, modifier = nil},
START_BOT = {key = _G.key.VK_DELETE, modifier = nil},
STOP_BOT = {key = _G.key.VK_END, modifier = nil}
},
options = {
ENABLE_FIGHT_SLOW_TURN = false,
MELEE_DISTANCE = 50,
LANGUAGE = "english",
USE_CLIENT_LANGUAGE = true, -- automatic use client language after loading the bot
DEBUGGING = false,
DEBUGGING_MACRO = false,
ROMDATA_PATH = nil,
TARGET_FRAME = true,
},
profile = {
options = {
-- common options
HP_LOW = 85,
MP_LOW_POTION = 50,
HP_LOW_POTION = 40,
COMBAT_TYPE = "melee",
COMBAT_RANGED_PULL = "true", -- only for melee classes , use ranged skill to pull
COMBAT_DISTANCE = 200,
ANTI_KS = true,
WAYPOINTS = "demo.xml",
RETURNPATH = nil,
PATH_TYPE = "waypoints",
WANDER_RADIUS = 500,
WAYPOINT_DEVIATION = 0,
LOOT = true,
LOOT_ALL = false,
LOOT_IGNORE_LIST_SIZE = 10,
LOOT_TIME = 1500,
LOOT_AGAIN = 2000, -- second loot try if rooted after x ms
LOOT_IN_COMBAT = true,
LOOT_DISTANCE = nil,
LOOT_PAUSE_AFTER = 10, -- probability in % for short pause after loot to look more human
HARVEST_DISTANCE = 120,
HARVEST_WOOD = true,
HARVEST_HERB = true,
HARVEST_ORE = true,
MAX_FIGHT_TIME = 10,
DOT_PERCENT = 90,
LOGOUT_TIME = 0,
LOGOUT_SHUTDOWN = false,
LOGOUT_WHEN_STUCK = true,
MAX_UNSTICK_TRIALS = 10,
TARGET_LEVELDIF_BELOW = 99,
TARGET_LEVELDIF_ABOVE = 99,
QUICK_TURN = false,
MP_REST = 15,
HP_REST = 15,
RES_AFTER_DEATH = false, -- automatic resurrect after death true|false,
HEALING_POTION = 0, -- shopping options, how many to buy/have in inventory
MANA_POTION = 0, -- shopping options, how many to buy/have in inventory
ARROW_QUIVER = 0, -- shopping options, how many to buy/have in inventory
THROWN_BAG = 0, -- shopping options, how many to buy/have in inventory
POISON = 0, -- shopping options, how many to buy/have in inventory
EGGPET_HOE = 0, -- shopping options, how many to buy/have in inventory
EGGPET_SPADE = 0, -- shopping options, how many to buy/have in inventory
EGGPET_HATCHET = 0, -- shopping options, how many to buy/have in inventory
RELOAD_AMMUNITION = false, -- false|arrow|thrown
EGGPET_ENABLE_CRAFT = false,
EGGPET_CRAFT_SLOT = nil,
EGGPET_ENABLE_ASSIST = false,
EGGPET_ASSIST_SLOT = nil,
EGGPET_CRAFT_RATIO = "1:1:1", -- mining:woodworking:herbalism ratio to use when crafting. '0' means do not craft that type.
EGGPET_CRAFT_INDEXES = ",,", -- Index level override for mine:wood:herb eg. ",,1" will only create index level 1 herb items
-- expert options
MAX_SKILLUSE_NODMG = 4, -- maximum casts without damaging the target before break it
MAX_TARGET_DIST = 250, -- maximum distance to select a target (helpfull to limit at small places)
AUTO_ELITE_FACTOR = 5, -- mobs with x * your HP value counts as 'Elite' and we will not target it
AUTO_TARGET = true, -- bot will target mobs automaticly (set it to false if you want to use the bot only as fight support)
-- SKILL_GLOBALCOOLDOWN = 1200, -- Global Skill Use Cooldown (1000ms) we use a little more
SKILL_USE_PRIOR = "auto", -- cast x ms before cooldown is finished
PK_COUNTS_AS_DEATH = true, -- count playerkill's as death
POTION_COOLDOWN = 15, -- always 15
POTION_COOLDOWN_HP = 0, -- will only be used if not 0, if 0 POTION_COOLDOWN will be used
POTION_COOLDOWN_MANA = 0, -- will only be used if not 0, if 0 POTION_COOLDOWN will be used
SIT_WHILE_RESTING = false, -- sit while using the rest function
USE_MANA_POTION = "best", -- which mana potion type to use: best | minstack
USE_HP_POTION = "best", -- which HP potion type to use: best | minstack
WAYPOINTS_REVERSE = false, -- use the waypoint file in reverse order
WAYPOINT_PASS = 100, -- skip a waypoint if we pass in distance x while fighting a mob (go to as melee)
WAYPOINT_PASS_DEGR = 90, -- skip a waypoint if we touched one and the next is at least x degrees in front
MAX_DEATHS = 10, -- maximal death if automatic resurrect befor logout
WAIT_TIME_AFTER_RES = 8000, -- time to wait after resurrection, needs more on slow PCs
RETURNPATH_SUFFIX = "_return", -- suffix for default naming of returnpath
HARVEST_SCAN_WIDTH = 5, -- steps horizontal
HARVEST_SCAN_HEIGHT = 5, -- steps vertical
HARVEST_SCAN_STEPSIZE = 60, -- wide of every step
HARVEST_SCAN_TOPDOWN = false, -- true = top->down false = botton->up
HARVEST_SCAN_XMULTIPLIER = 1.0, -- multiplier for scan width
HARVEST_SCAN_YMULTIPLIER = 1.1, -- multiplier for scan line height
HARVEST_SCAN_YREST = 10, -- scanspeed
HARVEST_SCAN_YMOVE = 1.1, -- move scan area top/down ( 1=middle of screen )
HARVEST_TIME = 45, -- how long we maximum harvest a node
USE_SLEEP_AFTER_RESUME = false, -- enter sleep mode after pressing pause/resume key
IGNORE_MACRO_ERROR = false, -- ignore missing MACRO hotkey error (only temporary option while beta)
DEBUG_INV = false, -- to help to find the item use error (only temporary option while beta)
DEBUG_LOOT = false, -- debug loot issues
DEBUG_TARGET = false, -- debug targeting issues
DEBUG_HARVEST = false, -- debug harvesting issues
DEBUG_WAYPOINT = false, -- debug waypoint issues
DEBUG_AUTOSELL = false, -- debug autosell issues
DEBUG_SKILLUSE = false, -- debug skill use issues
-- expert inventar
INV_UPDATE_INTERVAL = 300, -- full inventory update every x seconds (only used indirect atm)
INV_AUTOSELL_ENABLE = false, -- autosell items at merchant true|false
INV_AUTOSELL_FROMSLOT = 0, -- autosell from slot #
INV_AUTOSELL_TOSLOT = 0, -- autosell to slot #
INV_AUTOSELL_QUALITY = "white", -- itemcolors to sell
INV_AUTOSELL_IGNORE = nil, -- itemnames never so sell
INV_AUTOSELL_NOSELL_DURA = 0, -- durability > x will not sell, 0=sell all
INV_AUTOSELL_STATS_NOSELL = nil, -- stats (text search at right tooltip side) that will not be selled
INV_AUTOSELL_STATS_SELL = nil, -- stats (text search at right tooltip side) that will be selled, even if in nosell
INV_AUTOSELL_NOSELL_STATSNUMBER = 3,-- If the item has this many or more named stats then don't sell
},
hotkeys = { },
skills = nil,
skillsData = {},
friends = {},
mobs = {},
events = {
onDeath = nil,
onLoad = nil,
onLeaveCombat = nil,
onPreSkillCast = nil,
onSkillCast = nil,
onLevelup = nil,
onHarvest = nil,
onUnstickFailure = nil,
}
},
};
If I need helpAdministrator wrote: Do you still need help with it or not?
I'm trying to accomplish, at least to start the Rombot you can use but I want to put the code clean.Administrator wrote: What are you trying to accomplish?
Code: Select all
local t2 = table.copy(settings_default);
print("\n\nTab now:");
table.print(t2);
Code: Select all
Tab now:
hotkeys: table: 0x202C908
MOVE_BACKWARD: table: 0x20B4FF8
key: 83
STRAFF_RIGHT: table: 0x20B5098
key: 68
STOP_BOT: table: 0x20B5188
key: 35
JUMP: table: 0x20B50C0
key: 32
ROTATE_LEFT: table: 0x20B5020
key: 81
START_BOT: table: 0x20B5160
key: 46
ROTATE_RIGHT: table: 0x20B5048
key: 69
ESCAPE: table: 0x20B5138
key: 27
TARGET: table: 0x20B50E8
key: 9
MOVE_FORWARD: table: 0x20B4FD0
key: 87
TARGET_FRIEND: table: 0x20B5110
STRAFF_LEFT: table: 0x20B5070
key: 65
profile: table: 0x20B51D8
hotkeys: table: 0x20B5228
mobs: table: 0x20B52A0
options: table: 0x20B5200
MAX_TARGET_DIST: 250
HARVEST_DISTANCE: 120
EGGPET_HOE: 0
MP_LOW_POTION: 50
HARVEST_SCAN_YREST: 10
HARVEST_TIME: 45
DEBUG_SKILLUSE: (null)
EGGPET_CRAFT_RATIO: 1:1:1
COMBAT_RANGED_PULL: true
LOGOUT_WHEN_STUCK: (null)
INV_AUTOSELL_ENABLE: (null)
AUTO_TARGET: (null)
HARVEST_SCAN_XMULTIPLIER: 1
RELOAD_AMMUNITION: (null)
DEBUG_WAYPOINT: (null)
PK_COUNTS_AS_DEATH: (null)
HARVEST_HERB: (null)
MAX_FIGHT_TIME: 10
AUTO_ELITE_FACTOR: 5
SKILL_USE_PRIOR: auto
THROWN_BAG: 0
LOOT_IN_COMBAT: (null)
USE_MANA_POTION: best
HP_REST: 15
SIT_WHILE_RESTING: (null)
ARROW_QUIVER: 0
MP_REST: 15
POTION_COOLDOWN_HP: 0
TARGET_LEVELDIF_ABOVE: 99
HARVEST_SCAN_YMOVE: 1.1
POISON: 0
INV_AUTOSELL_NOSELL_STATSNUMBER: 3
INV_AUTOSELL_NOSELL_DURA: 0
EGGPET_ENABLE_CRAFT: (null)
HARVEST_ORE: (null)
POTION_COOLDOWN: 15
DEBUG_AUTOSELL: (null)
LOOT_TIME: 1500
DEBUG_INV: (null)
LOOT: (null)
INV_AUTOSELL_FROMSLOT: 0
POTION_COOLDOWN_MANA: 0
LOGOUT_TIME: 0
ANTI_KS: (null)
INV_UPDATE_INTERVAL: 300
DEBUG_HARVEST: (null)
WAYPOINT_DEVIATION: 0
LOOT_IGNORE_LIST_SIZE: 10
DEBUG_TARGET: (null)
COMBAT_TYPE: melee
DEBUG_LOOT: (null)
INV_AUTOSELL_TOSLOT: 0
EGGPET_SPADE: 0
HARVEST_SCAN_STEPSIZE: 60
INV_AUTOSELL_QUALITY: white
LOOT_ALL: (null)
DOT_PERCENT: 90
HARVEST_SCAN_YMULTIPLIER: 1.1
HEALING_POTION: 0
RETURNPATH_SUFFIX: _return
HARVEST_WOOD: (null)
COMBAT_DISTANCE: 200
RES_AFTER_DEATH: (null)
LOOT_AGAIN: 2000
TARGET_LEVELDIF_BELOW: 99
HARVEST_SCAN_WIDTH: 5
WAIT_TIME_AFTER_RES: 8000
PATH_TYPE: waypoints
MAX_DEATHS: 10
QUICK_TURN: (null)
LOGOUT_SHUTDOWN: (null)
WAYPOINT_PASS: 100
WAYPOINTS_REVERSE: (null)
USE_HP_POTION: best
USE_SLEEP_AFTER_RESUME: (null)
MAX_SKILLUSE_NODMG: 4
MANA_POTION: 0
EGGPET_CRAFT_INDEXES: ,,
EGGPET_ENABLE_ASSIST: (null)
WANDER_RADIUS: 500
HP_LOW_POTION: 40
HP_LOW: 85
MAX_UNSTICK_TRIALS: 10
EGGPET_HATCHET: 0
IGNORE_MACRO_ERROR: (null)
HARVEST_SCAN_HEIGHT: 5
WAYPOINT_PASS_DEGR: 90
HARVEST_SCAN_TOPDOWN: (null)
LOOT_PAUSE_AFTER: 10
WAYPOINTS: demo.xml
events: table: 0x20B52C8
skillsData: table: 0x20B5250
friends: table: 0x20B5278
options: table: 0x20B51B0
TARGET_FRAME: (null)
ENABLE_FIGHT_SLOW_TURN: (null)
MELEE_DISTANCE: 50
DEBUGGING: (null)
USE_CLIENT_LANGUAGE: (null)
DEBUGGING_MACRO: (null)
LANGUAGE: english
Code: Select all
atPause();
Code: Select all
local running = true;
function macro.main(dt)
if( not running )
return;
-- other code here.
end
function macro.event(e, data1, data2, data3)
if( e == "keypressed" ) then
if( not running and data1 == key.VK_F5 ) then
start();
end
if( running and data1 == key.VK_F6 ) then
pause();
end
end
end
function start()
print("Started. Press F6 to pause.");
end
function pause()
print("Paused. Press F5 to continue.");
end
Code: Select all
atPause(pauseCallback);
Code: Select all
function pauseCallback()
local msg = sprintf(language[46], getKeyName(getStartKey())); -- to continue, (CTRL+L) exit ...
releaseKeys();
printf(msg);
end
atPause(pauseCallback);
Code: Select all
local running = true;
function macro.main(dt)
if( not running )
return; --------------------------->>>error
-- other code here.
end
Code: Select all
2014-09-09 23:38:13 : MicroMacro version 1.9.18.260 (Alpha)
2014-09-09 23:38:13 : Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz @2500MHz, Windows 7
2014-09-09 23:38:13 : User privilege: Administrator
-------------------------------------------------------------------------------
2014-09-09 23:38:17 : Load file error code: 7 (Runtime error)
bot.lua:40: functions.lua:342: 'then' expected near 'return'
2014-09-09 23:38:40 : Process forcefully terminated (Win32 callback)
Users browsing this forum: No registered users and 19 guests