Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Keyevent

  1. #1
    iBot User 3173654's Avatar
    Join Date
    Aug 2012
    Posts
    1,393
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    28 Post(s)
    Reputation
    202
    Rep Power
    9

    Keyevent

    Hello!

    I'm trying to do an action to reconnect the next char, and I thought I'd use the keyevent() function.

    with a very simple action
    PHP Code:
    if stamina 920 and pzone == true then 
    wait
    (10001500
    logout () 
    wait(4000
    keyevent(0x28
    wait(10000120000
    keyevent(0xD
    wait(4000)
    pausewalking(10000
    end 
    where "keyevent(0xD) is the enter key, but not works .. SIRMATE LIBRARY:


    ed1t!

    keyevent(0xD) works in game, but in select character not
    http://www.tibiaibot.com/forum/showthread.php?16907-FREE-Scripts-3173654&highlight=3173654+free+scripts

  2. #2
    iBot User 3173654's Avatar
    Join Date
    Aug 2012
    Posts
    1,393
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    28 Post(s)
    Reputation
    202
    Rep Power
    9
    any suggestions? '-'
    http://www.tibiaibot.com/forum/showthread.php?16907-FREE-Scripts-3173654&highlight=3173654+free+scripts

  3. #3
    iBot User 3173654's Avatar
    Join Date
    Aug 2012
    Posts
    1,393
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    28 Post(s)
    Reputation
    202
    Rep Power
    9
    Help =s
    http://www.tibiaibot.com/forum/showthread.php?16907-FREE-Scripts-3173654&highlight=3173654+free+scripts

  4. #4
    Normal User RafiXWPT's Avatar
    Join Date
    Jun 2012
    Location
    (Poland) http://rafixwptscripts.com
    Posts
    1,602
    Mentioned
    31 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    128 Post(s)
    Reputation
    128
    Rep Power
    9
    what about....
    Lua Code:
    if stamina < 920 and pzone == true then 
    wait(1000, 1500) 
    logout () 
    while not connected do
    connect("accname", "accpaswd", "nick") 
    wait(500,750)
    end
    end

  5. #5
    iBot User 3173654's Avatar
    Join Date
    Aug 2012
    Posts
    1,393
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    28 Post(s)
    Reputation
    202
    Rep Power
    9
    Quote Originally Posted by RafiXWPT View Post
    what about....
    Lua Code:
    if stamina < 920 and pzone == true then 
    wait(1000, 1500) 
    logout () 
    while not connected do
    connect("accname", "accpaswd", "nick") 
    wait(500,750)
    end
    end
    thank you RafixWPT, more precisely because I have a problem with this kind of reconnect, I decided to use KeyEvent (), in which cas the problem I have, is that being in character selection, it will last straight to the list, and to it, as if I had holding the down arrow, already tested in several scripts, various actions (including the blakw) and this bug happens, you know what can be?

    --

    and my purpose in this type of reconnect, is to create an action that reconnects when the next char end stamina in the case, arriving at last there will be an action that tightens up arrow 2 times and back to the first
    http://www.tibiaibot.com/forum/showthread.php?16907-FREE-Scripts-3173654&highlight=3173654+free+scripts

  6. #6
    iScripter Eli's Avatar
    Join Date
    Mar 2012
    Posts
    3,764
    Mentioned
    492 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    955 Post(s)
    Reputation
    586
    Rep Power
    10
    Try this:
    Lua Code:
    local CHARACTERS = {"Char1", "Char2", "Char3", "Char4", "Char5"} -- You may add more
    local AccName = "****************"
    local AccPass = "****************"
    local LoopThroughCharacterList = false  -- relog from last character to first on list
     
     
    if not connected then
        function getindex(value, array)
            for k, v in ipairs(array) do
                if v == value then
                    return k
                end
            end
            return 0
        end
     
        function table.copy(t)
            local t2 = {}
            for k, v in pairs(t) do
                t2[k] = v
            end
            return t2
        end
     
        local CHARACTERS_COPY = table.copy(CHARACTERS)
        local CurrentCharacter = name
        local NextCharIndex = (getindex(CurrentCharacter, CHARACTERS) % table.getn(CHARACTERS)) + 1
     
        table.remove(CHARACTERS_COPY, getindex(CurrentCharacter, CHARACTERS_COPY))
        table.remove(CHARACTERS_COPY, getindex(CHARACTERS[NextCharIndex], CHARACTERS_COPY))
     
        if getindex(CurrentCharacter, CHARACTERS) == 0 or (not LoopThroughCharacterList and getindex(CurrentCharacter, CHARACTERS) == table.getn(CHARACTERS)) then
            setcavebot("no")
            message("Character not specified in setup or reached end of character list. Pausing script...")
            while not connected do wait(10000) updateworld() end
        else
            for k, v in ipairs(CHARACTERS_COPY) do
                while not connected do
                    connect(AccName, AccPass, CHARACTERS_COPY[k])
                    updateworld()
                end
                wait(700, 900)
                if islocationxyz(33239, 32409, 7, 5) then
                    if WeaponType == "axe" then
                        while connected do
                            reachlocation(xyz)
                            wait(300, 400)
                            useitem(16199, (xyz)
                            updateworld()
                        end
                    elseif WeaponType == "sword" then
                        while connected do
                            reachlocation(xyz)
                            wait(300, 400)
                            useitem(16198, xyz)
                            updateworld()
                        end
                    else
                        while connected do
                            reachlocation(xyz)
                            wait(300, 400)
                            useitem(16200, xyz)
                            updateworld()
                        end
                    end
                else
                    while connected do
                        logout()
                        updateworld()
                    end
                end
                wait(800, 1200)
            end    
     
            while not connected do
                connect(AccName, AccPass, CHARACTERS[NextCharIndex])
                updateworld()
            end
        end
     
        wait(800, 1000)
        updateworld()
     
        setcavebot("yes")
    end

  7. #7
    iBot User 3173654's Avatar
    Join Date
    Aug 2012
    Posts
    1,393
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    28 Post(s)
    Reputation
    202
    Rep Power
    9
    Quote Originally Posted by Eli View Post
    Try this:
    Lua Code:
    local CHARACTERS = {"Char1", "Char2", "Char3", "Char4", "Char5"} -- You may add more
    local AccName = "****************"
    local AccPass = "****************"
    local LoopThroughCharacterList = false  -- relog from last character to first on list
     
     
    if not connected then
        function getindex(value, array)
            for k, v in ipairs(array) do
                if v == value then
                    return k
                end
            end
            return 0
        end
     
        function table.copy(t)
            local t2 = {}
            for k, v in pairs(t) do
                t2[k] = v
            end
            return t2
        end
     
        local CHARACTERS_COPY = table.copy(CHARACTERS)
        local CurrentCharacter = name
        local NextCharIndex = (getindex(CurrentCharacter, CHARACTERS) % table.getn(CHARACTERS)) + 1
     
        table.remove(CHARACTERS_COPY, getindex(CurrentCharacter, CHARACTERS_COPY))
        table.remove(CHARACTERS_COPY, getindex(CHARACTERS[NextCharIndex], CHARACTERS_COPY))
     
        if getindex(CurrentCharacter, CHARACTERS) == 0 or (not LoopThroughCharacterList and getindex(CurrentCharacter, CHARACTERS) == table.getn(CHARACTERS)) then
            setcavebot("no")
            message("Character not specified in setup or reached end of character list. Pausing script...")
            while not connected do wait(10000) updateworld() end
        else
            for k, v in ipairs(CHARACTERS_COPY) do
                while not connected do
                    connect(AccName, AccPass, CHARACTERS_COPY[k])
                    updateworld()
                end
                wait(700, 900)
                if islocationxyz(33239, 32409, 7, 5) then
                    if WeaponType == "axe" then
                        while connected do
                            reachlocation(xyz)
                            wait(300, 400)
                            useitem(16199, (xyz)
                            updateworld()
                        end
                    elseif WeaponType == "sword" then
                        while connected do
                            reachlocation(xyz)
                            wait(300, 400)
                            useitem(16198, xyz)
                            updateworld()
                        end
                    else
                        while connected do
                            reachlocation(xyz)
                            wait(300, 400)
                            useitem(16200, xyz)
                            updateworld()
                        end
                    end
                else
                    while connected do
                        logout()
                        updateworld()
                    end
                end
                wait(800, 1200)
            end    
     
            while not connected do
                connect(AccName, AccPass, CHARACTERS[NextCharIndex])
                updateworld()
            end
        end
     
        wait(800, 1000)
        updateworld()
     
        setcavebot("yes")
    end
    Thank you Eli, i will try in my house... thanks
    http://www.tibiaibot.com/forum/showthread.php?16907-FREE-Scripts-3173654&highlight=3173654+free+scripts

  8. #8
    Normal User
    Join Date
    Jun 2012
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    11 Post(s)
    Reputation
    13
    Rep Power
    5
    Is there any way to make it relogg to another account?

    As I got deleted with all accs with 3x char per acc haha

    Thanks if someone could figure it out!
    HI CAN I USE THIS??????

  9. #9
    iBot User 3173654's Avatar
    Join Date
    Aug 2012
    Posts
    1,393
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    28 Post(s)
    Reputation
    202
    Rep Power
    9
    @Eli,

    did not work face the same problem in the character selection screen, as if I were holding the down arrow, stopping logging in the char pre-established

    thanks anyway.
    http://www.tibiaibot.com/forum/showthread.php?16907-FREE-Scripts-3173654&highlight=3173654+free+scripts

  10. #10
    iScripter Eli's Avatar
    Join Date
    Mar 2012
    Posts
    3,764
    Mentioned
    492 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    955 Post(s)
    Reputation
    586
    Rep Power
    10
    Quote Originally Posted by 3173654 View Post
    @Eli,

    did not work face the same problem in the character selection screen, as if I were holding the down arrow, stopping logging in the char pre-established

    thanks anyway.
    I use it now, it's working correct in case missed charcter like from 1 to 3, bot will logout and log to correct one.

Posting Permissions

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