XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 6 of 6

Thread: Fast lua editing in Game

  1. #1
    Senior Member Tripkip's Avatar
    Join Date
    Aug 2012
    Location
    Netherlands
    Posts
    1,310
    Mentioned
    105 Post(s)
    Tagged
    0 Thread(s)

    Fast lua editing in Game

    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 [QuickConfig] All the code you want to be able to be edited fast [/QuickConfig]
    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

    [QuickConfig]lua code:
    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
    [/QuickConfig]
    Last edited by Tripkip; 04-02-2014 at 10:12 AM.
    Tripkips Selling Thread

    Chars Sold
    Sold 445 MS to @zemmer
    Sold 430 RP to @Spanirl
    Sold 395 ED to @Poppy218
    Sold 381 ED to @Diixon
    Sold 370 MS to @Starcream
    Sold 325 ED to @itscolbys
    Sold 325 ED to @Diixon
    Sold 320+ ED to @rickmyth
    Sold 280 ED to @Lavi
    Sold 280 MS to @Nostrax Junior
    Sold 245 EK to @zgredzikq10
    Sold 204 MS to @avian45
    Sold 185 ED to @Scherp Schutter
    Sold 140 EK to @GuiCyp
    Sold 104 RP +107 ED to @zetashion

    Money Sold
    Sold 50kk to @kimse
    Sold 30kk @Diixon

  2. #2
    Banned
    Join Date
    Dec 2012
    Posts
    240
    Mentioned
    24 Post(s)
    Tagged
    0 Thread(s)
    What if I told you, you can actually change the value of variables from within the game without re-loading the script.

  3. #3
    Senior Member Tripkip's Avatar
    Join Date
    Aug 2012
    Location
    Netherlands
    Posts
    1,310
    Mentioned
    105 Post(s)
    Tagged
    0 Thread(s)
    @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.
    Tripkips Selling Thread

    Chars Sold
    Sold 445 MS to @zemmer
    Sold 430 RP to @Spanirl
    Sold 395 ED to @Poppy218
    Sold 381 ED to @Diixon
    Sold 370 MS to @Starcream
    Sold 325 ED to @itscolbys
    Sold 325 ED to @Diixon
    Sold 320+ ED to @rickmyth
    Sold 280 ED to @Lavi
    Sold 280 MS to @Nostrax Junior
    Sold 245 EK to @zgredzikq10
    Sold 204 MS to @avian45
    Sold 185 ED to @Scherp Schutter
    Sold 140 EK to @GuiCyp
    Sold 104 RP +107 ED to @zetashion

    Money Sold
    Sold 50kk to @kimse
    Sold 30kk @Diixon

  4. #4
    Banned
    Join Date
    Dec 2012
    Posts
    240
    Mentioned
    24 Post(s)
    Tagged
    0 Thread(s)
    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.



    lua code:
    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.
    lua code:
    table.insert(WhiteList, XenoBotValue)
    Last edited by Colte; 04-02-2014 at 01:02 PM.

  5. #5
    Senior Member Tripkip's Avatar
    Join Date
    Aug 2012
    Location
    Netherlands
    Posts
    1,310
    Mentioned
    105 Post(s)
    Tagged
    0 Thread(s)
    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!
    Tripkips Selling Thread

    Chars Sold
    Sold 445 MS to @zemmer
    Sold 430 RP to @Spanirl
    Sold 395 ED to @Poppy218
    Sold 381 ED to @Diixon
    Sold 370 MS to @Starcream
    Sold 325 ED to @itscolbys
    Sold 325 ED to @Diixon
    Sold 320+ ED to @rickmyth
    Sold 280 ED to @Lavi
    Sold 280 MS to @Nostrax Junior
    Sold 245 EK to @zgredzikq10
    Sold 204 MS to @avian45
    Sold 185 ED to @Scherp Schutter
    Sold 140 EK to @GuiCyp
    Sold 104 RP +107 ED to @zetashion

    Money Sold
    Sold 50kk to @kimse
    Sold 30kk @Diixon

  6. #6
    Banned
    Join Date
    Dec 2012
    Posts
    240
    Mentioned
    24 Post(s)
    Tagged
    0 Thread(s)
    Here's the full list of commands added to the channel.

    lua code:
    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.')



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •