Log in

View Full Version : Fast lua editing in Game



Tripkip
04-02-2014, 10:09 AM
Today I was showering... Yeah I shower kekek! But as we all know alot of good idea's are born there.

So My suggestion is. Sometimes when im pvping, or botting. I dont have the time or, I feel to lazy to actually open the lua files and edit the script.

So heres my proposal, not sure if its worth the time to create this, or maybe its rather easy to make and therefor it could be implented while updating the bot anyways.

When you go to scripter, you see the files you've executed, lets say: Sio.lua
Scripters would make a All the code you want to be able to be edited fast
And when you're hovering on 1 of the lua files that are executed you would see some sort of HUD Showing the QuickConfig text. (kinda like with the backpack HUD under the tool Function).when you click on this Text Balloon You'll be able to edit the text and save it whenever you click away, or ctrl+S. Ofcourse this function could be enabled/disabled under the tool section.
This way you can edit true/false things fast, backpack setups, Percentages and stuff like that. When time is essential, like in wars this could be really usefull.

What do you think? Might not be the most important function, also I know several suggestion KINDA like this 1 have been suggested. Altho this 1 might be easy to make ore better pruposed :P.

EXAMPLE VVVVV

local HealType = "UH" -- Main Heal Type (Options: "Sio", "UH", "IH") (type them exactly as I have them here)
local HealingRuneBP = "crown backpack" -- Name of OPEN backpack containing the healing runes.
local PercentHPtoHeal = 85 -- PERCENTAGE of health and below to sio/uh/ih party members&war allies
local RandHP = 0 -- Health randomization percentage (over 5% is unnecessary and can cause slow heal times)
local SelfMP = 1000 -- Minimum amount of mana to have when using SIO ONLY (actual mana, not a percentage)
local RandMP = 0 -- Mana randomization percentage (over 5% is unnecessary and can cause slow heal times)
local SelfHP = 1200 -- Minimum health to have before using sio/ih/uh (actual health, not a percentage)
local RandHP2 = 0 -- Self health randomization percentage (over 5% is unnecessary and can cause slow heal times)
local HealParty = false -- Heal All Party members, true/false
local HealWarAllies = false -- Heal All WarAllies, true/false
local HealWhiteList = true -- Heal All White list players, true/false
local WhiteList = {"Darkstar", ""} -- names of players to heal as long as "HealWhiteList" is true

Colte
04-02-2014, 11:42 AM
What if I told you, you can actually change the value of variables from within the game without re-loading the script.

Tripkip
04-02-2014, 12:06 PM
Colte Well withouth the explenation of how to do it, it brings me nowhere. And if this requires lua files reading text documents or a channel to edit variables. this would require lua scripting skills wich not everybody has. So my proposal remains, but feel free to share how you do it.

Colte
04-02-2014, 12:53 PM
The easiest way to do this is by making a chat channel where you easily can add your own commands and then be able to set values to their variables.
Save this as SettingsChannel.lua or whatever and run it.
Here's an example of the two first variables in your config, added them already.
Then you can just add more to it.
There's an example on the wiki for chat channels if you got trouble understanding it.

http://i.imgur.com/P1YwwWd.png

local HealType = "UH" -- Main Heal Type (Options: "Sio", "UH", "IH") (type them exactly as I have them here)
local HealingRuneBP = "crown backpack" -- Name of OPEN backpack containing the healing runes.

function Speaker(XenoBotChannel, XenoBotMessage)
XenoBotChannel:SendYellowMessage('You', XenoBotMessage)
XenoBotMessage:trim():lower()

local XenoBotCommand, XenoBotValue = XenoBotMessage:match('^/([a-z]+) (.+)$')
if (XenoBotCommand) then
------------------------------
---- First variable here -----
------------------------------
if (XenoBotCommand == 'healtype') then
if (XenoBotValue) then
if (XenoBotValue == 'sio' or XenoBotValue == 'uh' or XenoBotValue == 'ih') then
if (XenoBotValue == 'sio') then
HealType = "Sio"
XenoBotChannel:SendOrangeMessage('XenoBot', 'Healtype set to Sio.')
elseif (XenoBotValue == 'uh') then
HealType = "UH"
XenoBotChannel:SendOrangeMessage('XenoBot', 'Healtype set to UH.')
elseif (XenoBotValue == 'ih') then
HealType = "IH"
XenoBotChannel:SendOrangeMessage('XenoBot', 'Healtype set to IH.')
end
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end
------------------------------
--- Second variable here -----
------------------------------
elseif (XenoBotCommand == 'healingrunebp') then
if (XenoBotValue) then
if (XenoBotValue ~= '') then
HealingRuneBP = XenoBotValue
XenoBotChannel:SendOrangeMessage('XenoBot', 'HealingRuneBP set to ' ..XenoBotValue.. '.')
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end
------------------------------
---- Third variable here -----
------------------------------
-- I havent added it yet.
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Unknown command.')
end
end
end

function Closer(XenoBotChannel)
print('Xenobot: XenoBot chat has closed.')
end

local XenoBotChat = Channel.Open('XB Chat', Speaker, Closer)
XenoBotChat:SendOrangeMessage('XenoBot', 'In this chat you can change your settings.')

For the whitelist, just do this when you set the value.
table.insert(WhiteList, XenoBotValue)

Tripkip
04-02-2014, 01:33 PM
This is indeed very nice for a Sio list!
altho this wasnt the only reason why I proposed this. And for many people this is still quite hard to understand! Also im getting so many scripts wich will open a channel, I would have to start tabbing to find the right 1, or ill start typing in default chat (wich would look really weird). Also i can't use levitate or any other spell with (") in it like utevo res ". because it will be blocked by the channel.

As you can see it has some flaws, yet I like what you did, and its a nice workaround, my proposal remains, it would make our lifes easyer, especially for the noobies that dont know lua!

Colte
04-02-2014, 01:34 PM
Here's the full list of commands added to the channel.

local HealType = "UH" -- Main Heal Type (Options: "Sio", "UH", "IH") (type them exactly as I have them here)
local HealingRuneBP = "crown backpack" -- Name of OPEN backpack containing the healing runes.
local PercentHPtoHeal = 85 -- PERCENTAGE of health and below to sio/uh/ih party members&war allies
local RandHP = 0 -- Health randomization percentage (over 5% is unnecessary and can cause slow heal times)
local SelfMP = 1000 -- Minimum amount of mana to have when using SIO ONLY (actual mana, not a percentage)
local RandMP = 0 -- Mana randomization percentage (over 5% is unnecessary and can cause slow heal times)
local SelfHP = 1200 -- Minimum health to have before using sio/ih/uh (actual health, not a percentage)
local RandHP2 = 0 -- Self health randomization percentage (over 5% is unnecessary and can cause slow heal times)
local HealParty = false -- Heal All Party members, true/false
local HealWarAllies = false -- Heal All WarAllies, true/false
local HealWhiteList = true -- Heal All White list players, true/false
local WhiteList = {"Darkstar", ""} -- names of players to heal as long as "HealWhiteList" is true

function Speaker(XenoBotChannel, XenoBotMessage)
XenoBotChannel:SendYellowMessage('You', XenoBotMessage)
XenoBotMessage:trim():lower()

local XenoBotCommand, XenoBotValue = XenoBotMessage:match('^/([a-z]+) (.+)$')
if (XenoBotCommand) then
------------------------------
---- First variable here -----
------------------------------
if (XenoBotCommand == 'healtype') then
if (XenoBotValue) then
if (XenoBotValue == 'sio' or XenoBotValue == 'uh' or XenoBotValue == 'ih') then
if (XenoBotValue == 'sio') then
HealType = "sio"
XenoBotChannel:SendOrangeMessage('XenoBot', 'Healtype set to Sio.')
elseif (XenoBotValue == 'uh') then
HealType = "uh"
XenoBotChannel:SendOrangeMessage('XenoBot', 'Healtype set to UH.')
elseif (XenoBotValue == 'ih') then
HealType = "ih"
XenoBotChannel:SendOrangeMessage('XenoBot', 'Healtype set to IH.')
end
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end
------------------------------
--- Second variable here -----
------------------------------
elseif (XenoBotCommand == 'healingrunebp') then
if (XenoBotValue) then
if (XenoBotValue ~= '') then
HealingRuneBP = XenoBotValue
XenoBotChannel:SendOrangeMessage('XenoBot', 'HealingRuneBP set to ' ..XenoBotValue.. '.')
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end
------------------------------
---- Third variable here -----
------------------------------
elseif (XenoBotCommand == 'percenthptoheal') then
if (XenoBotValue) then
if (XenoBotValue ~= nil) then
PercentHPtoHeal = XenoBotValue
XenoBotChannel:SendOrangeMessage('XenoBot', 'PercentHPtoHeal set to ' ..XenoBotValue.. '.')
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end
------------------------------
---- And so on -----
------------------------------
elseif (XenoBotCommand == 'randhp') then
if (XenoBotValue) then
if (XenoBotValue ~= nil) then
RandHP = XenoBotValue
XenoBotChannel:SendOrangeMessage('XenoBot', 'RandHP set to ' ..XenoBotValue.. '.')
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end

elseif (XenoBotCommand == 'selfmp') then
if (XenoBotValue) then
if (XenoBotValue ~= nil) then
SelfMP = XenoBotValue
XenoBotChannel:SendOrangeMessage('XenoBot', 'SelfMP set to ' ..XenoBotValue.. '.')
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end

elseif (XenoBotCommand == 'randmp') then
if (XenoBotValue) then
if (XenoBotValue ~= nil) then
RandMP = XenoBotValue
XenoBotChannel:SendOrangeMessage('XenoBot', 'RandMP set to ' ..XenoBotValue.. '.')
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end

elseif (XenoBotCommand == 'selfhp') then
if (XenoBotValue) then
if (XenoBotValue ~= nil) then
SelfHP = XenoBotValue
XenoBotChannel:SendOrangeMessage('XenoBot', 'SelfHP set to ' ..XenoBotValue.. '.')
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end

elseif (XenoBotCommand == 'healparty') then
if (XenoBotValue) then
if (XenoBotValue == 'true' or XenoBotValue == 'false') then
if (XenoBotValue == 'true') then
HealParty = true
XenoBotChannel:SendOrangeMessage('XenoBot', 'HealParty set to ' ..XenoBotValue.. '.')
elseif (XenoBotValue == 'false') then
HealParty = false
XenoBotChannel:SendOrangeMessage('XenoBot', 'HealParty set to ' ..XenoBotValue.. '.')
end
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end

elseif (XenoBotCommand == 'healwarallies') then
if (XenoBotValue) then
if (XenoBotValue == 'true' or XenoBotValue == 'false') then
if (XenoBotValue == 'true') then
HealWarAllies = true
XenoBotChannel:SendOrangeMessage('XenoBot', 'HealWarAllies set to ' ..XenoBotValue.. '.')
elseif (XenoBotValue == 'false') then
HealWarAllies = false
XenoBotChannel:SendOrangeMessage('XenoBot', 'HealWarAllies set to ' ..XenoBotValue.. '.')
end
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end

elseif (XenoBotCommand == 'healwhitelist') then
if (XenoBotValue) then
if (XenoBotValue == 'true' or XenoBotValue == 'false') then
if (XenoBotValue == 'true') then
HealWhiteList = true
XenoBotChannel:SendOrangeMessage('XenoBot', 'HealWhiteList set to ' ..XenoBotValue.. '.')
elseif (XenoBotValue == 'false') then
HealWhiteList = false
XenoBotChannel:SendOrangeMessage('XenoBot', 'HealWhiteList set to ' ..XenoBotValue.. '.')
end
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end
end

elseif (XenoBotCommand == 'whitelist') then
if (XenoBotValue) then
table.insert(WhiteList, XenoBotValue)
XenoBotChannel:SendOrangeMessage('XenoBot', 'Added ' ..XenoBotValue.. ' to whitelist.')
else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Error, unknown command.')
end

else
XenoBotChannel:SendOrangeMessage('XenoBot', 'Unknown command.')
end
end
end

function Closer(XenoBotChannel)
print('Xenobot: XenoBot chat has closed.')
end

local XenoBotChat = Channel.Open('XB Chat', Speaker, Closer)
XenoBotChat:SendOrangeMessage('XenoBot', 'In this chat you can change your settings.')

http://i.imgur.com/IAwoLzw.png