Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: npcsay(..cast("hi")..) or something similar

  1. #1
    iBot User
    Join Date
    Sep 2012
    Posts
    239
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    46 Post(s)
    Reputation
    23
    Rep Power
    5

    npcsay(..cast("hi")..) or something similar

    Hello,

    I am one of those who are waiting for the development of a Client Mod. As far as I know, Jonatas has the idea in mind, but it's not a priority at the moment.

    I open a lot of MCs and my computer becomes so slow, that at times my chars have trouble typing when they are talking to the NPC.

    It would be interesting if instead of typing, the bot could press a hotkey containing basic words, like (I assume the function cast() uses the hotkeys F1 - F12):

    npcsay(..cast("hi")..)
    npcsay(..cast("yes")..)
    npcsay(..cast("trade")..)
    npcsay(..cast("withdraw")..)

    I hope I am being clear. Is it possible to do this?

  2. #2
    Banned
    Join Date
    May 2012
    Posts
    680
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    24
    Rep Power
    0
    Wont work, Tibia doesn't allow all keywords to be used via hotkey, try it out. It's sadly something we'll have to wait for clientmods until we can utilize

  3. #3
    Normal User dragonicevo's Avatar
    Join Date
    May 2012
    Location
    canada
    Posts
    1,600
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    65
    Rep Power
    8
    local mps = positive(mpbuy - itemcount("mana potion")) * 50
    local hps = positive(hpbuy - itemcount("strong health potion")) * 100
    local Total = mps + hps

    wait(500,1000)
    say("hi")
    wait(1500,2000)
    npcsay("deposit all")
    wait(1000,1300)
    npcsay("yes")
    wait(1000,1300)
    npcsay("balance")
    wait(2000)
    npcsay("withdraw "..Total)
    wait(1000,1300)
    npcsay("yes")
    wait(1000,1300)
    for bank like this check my tutorial for more.
    http://www.tibiaibot.com/forum/showt...2925#post42925 for basic setup for knight

    If i helped or you liked my scripts rep + me

    trusted free scripts by pink_panther and 3173654 and acid alchamy and marlhex and spens13

  4. #4
    iBot User
    Join Date
    Sep 2012
    Posts
    239
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    46 Post(s)
    Reputation
    23
    Rep Power
    5
    Quote Originally Posted by dragonicevo View Post
    for bank like this check my tutorial for more.
    But the bot will have to type the message with that code. I'd rather have the text in my hotkeys so that the bot can press the hotkey, instead of typing. When you are with too much lag, typing is a difficult task for the bot.

  5. #5
    Normal User dragonicevo's Avatar
    Join Date
    May 2012
    Location
    canada
    Posts
    1,600
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    65
    Rep Power
    8
    i do understand what your saying as i have seen it have hard time with typing sometimes but always works for me and if it doesnt for you or others then it should be worked on and improve the owner of ibot works very hard at many things people dont know that cuz they dont understand how difficult it is.
    http://www.tibiaibot.com/forum/showt...2925#post42925 for basic setup for knight

    If i helped or you liked my scripts rep + me

    trusted free scripts by pink_panther and 3173654 and acid alchamy and marlhex and spens13

  6. #6
    Normal User
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,671
    Mentioned
    18 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    8 Post(s)
    Reputation
    132
    Rep Power
    9
    Change Settings > Input > Keyboard > TypingStyle to Clipboard

    I think this will work with npc channel, not sure though.
    Last edited by soder; 11-22-2012 at 03:13 PM.

  7. #7
    Normal User
    Join Date
    Oct 2012
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    You can always use keyevent.

    PHP Code:
    say("hi") -- So that youre talking in NPCs
    wait
    (2000,3000)
    keyevent(0x70) -- F1without "Send automatically"
    wait(1000)
    keyevent(0xD) -- Enter 
    I have the text "ARGH" on F1 and when it presses Enter it would write the text.

    Don't know if this solution is good enough. :P

  8. #8
    iBot User
    Join Date
    Sep 2012
    Posts
    239
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    46 Post(s)
    Reputation
    23
    Rep Power
    5
    Quote Originally Posted by Ropiderz View Post
    Add this to your library standard.lua and then use the normal function npcsay(string text). You can use hotkeys from F1 to Control + F12.

    Code:
    _NPCSAY = _NPCSAY or npcsay
    function npcsay(TEXT)
        return (clienttexthotkey(TEXT) ~= "not found" and cast(TEXT)) or _NPCSAY(TEXT)
    end
    Not bad, but it needs improving. The bot casts the hotkey and then type the word as well, so the same thing is said twice.

    If the word/sentence is in the hotkey, cast it, otherwise type the text. Can you modify the code to do that?
    Last edited by john86; 11-23-2012 at 03:05 PM.

  9. #9
    iBot User
    Join Date
    Sep 2012
    Posts
    239
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    46 Post(s)
    Reputation
    23
    Rep Power
    5
    Quote Originally Posted by Ropiderz View Post
    I've tested clipboard as soder said but it don't works good so I believe this is the best solution for now. Try this one:

    Code:
    _NPCSAY = _NPCSAY or npcsay
    
    function npcsay(TEXT)
        if clienttexthotkey(TEXT) ~= "not found" then
            return cast(TEXT)
        else
            return _NPCSAY(TEXT)
        end
    end
    Now it works, except that npcsay() will cast the word in the current channel instead of changing channel to "NPCs". A little tweaking may do the job I think.

    Edit:

    Fixed it (change in bold):

    Code:
    _NPCSAY = _NPCSAY or npcsay
    
    function npcsay(TEXT)
        if clienttexthotkey(TEXT) ~= "not found" then
            npcsay("")
            return cast(TEXT)
        else
            return _NPCSAY(TEXT)
        end
    end
    Lame I know, but at least it works.

    Edit 2:

    Debug error: stack overflow. So I didn't fix nuthin'
    Last edited by john86; 11-23-2012 at 05:39 PM.

  10. #10
    Normal User dragonicevo's Avatar
    Join Date
    May 2012
    Location
    canada
    Posts
    1,600
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    65
    Rep Power
    8
    goodjob as always ropiderz
    http://www.tibiaibot.com/forum/showt...2925#post42925 for basic setup for knight

    If i helped or you liked my scripts rep + me

    trusted free scripts by pink_panther and 3173654 and acid alchamy and marlhex and spens13

Posting Permissions

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