Page 1 of 6 123 ... LastLast
Results 1 to 10 of 54

Thread: CPU usage fix/tip (3x less cpu usage!)

  1. #1
    Focus Group bofing's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    664
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    52 Post(s)
    Reputation
    95
    Rep Power
    6

    CPU usage fix/tip (3x less cpu usage!)

    Hello!

    first of all: CREDITS TO JONATAS/SIRMATE FOR FINDING OUT WHAT WAS WRONG

    If you got not bad pc and having cpu usage problems, this tutorial/tip might be for you. So high cpu usage in my situation is not caused by ibot itself but by wrong made actions that's checking your tibia chats. Did you maybe noticed botting is easy right after you start your bots and you can start like 5-6 bots then but after some time it's impossible to bot even 3-4 tibias? It's caused by "getmessages" function that's checking each text on your Server Log/NPCs/Local Chat in Tibia.

    The solution is so easy, edit "getmessages" in your actions like (safe bank, unjust checker, mass res alert etc - everything that's made with tibia chats checkers) to "getnewmessages", this functions will not check all your texts on tibia chats but only new ones, by that your cpu usage will be much much lower.

    I'm using intel core i5-2500 @ 3.3GHz and 8gb RAM

    This is a screenshot of my cpu usage before editing any action (botting 4 tibias, 1 manual)




    This is result I got after editing actions:




    How to edit your actions?

    go to Settings > Actions > List > open each action and search for getmessages > edit each getmessages to getnewmessages


    wrong action example:
    PHP Code:
    local msgs getmessages("Local Chat"
    local qtd msgs.count-

    for i=0,qtd 
    do 
        if 
    msgs[qtd-i].text:find("exura gran mas res"
        
    then 
        playsound
    ("alert.wav")    
        
    end 
    end 
    edited action example:
    PHP Code:
    local msgs getnewmessages("Local Chat"
    local qtd msgs.count-

    for i=0,qtd 
    do 
        if 
    msgs[qtd-i].text:find("exura gran mas res"
        
    then 
        playsound
    ("alert.wav")    
        
    end 
    end 
    and done! your cpu usage should be much lower now
    Last edited by bofing; 09-16-2012 at 06:35 PM.

  2. #2
    Focus Group bofing's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    664
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    52 Post(s)
    Reputation
    95
    Rep Power
    6
    Now I feel I can bot up to 10 tibias


  3. #3
    iBot User
    Join Date
    May 2012
    Location
    Albufeira/Portugal
    Posts
    82
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    10 Post(s)
    Reputation
    11
    Rep Power
    5
    soooo that means that we'll have a CPU usage fix in next bot version?
    Soon, my own store!
    Vocation
    Level
    Script
    Status

  4. #4
    Focus Group bofing's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    664
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    52 Post(s)
    Reputation
    95
    Rep Power
    6
    Quote Originally Posted by pavelitoo View Post
    soooo that means that we'll have a CPU usage fix in next bot version?
    I don't think so cause getmessages function can be used for some actions in some way but using it for safe bank/unjust alert etc is a wrong way :P Good scripters will for sure update their scripts with getnewmessages now but there is still a lot actions here on forum made with getmessages instead of getnewmessages

  5. #5
    Banned
    Join Date
    Sep 2012
    Location
    Poland
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    23
    Rep Power
    0
    I will test it, anyway good job.

  6. #6
    Normal User Stoned's Avatar
    Join Date
    Jul 2012
    Location
    New York
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    13
    Rep Power
    5
    Very nice seems to work for me =)

  7. #7
    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
    im botting 3 mc's, cpu usage: 45-50%, when I changed to getnewmessages CPU usage: 43-48%, nothing special : d

  8. #8
    Normal User
    Join Date
    Aug 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    I editted this hotkey of recent loot:

    PHP Code:
    -- you can add more items here
    local warnitems 
    = {'skull staff''blue robe''broken key ring''amber staff''red robe''lunar staff''spider silk''sapphire hammer''boots of haste''war axe''giant sword''chaos mace''dreaded cleaver''steel boots''skull helmet''titan axe''haunted blade''tower shield''amulet of loss'}

    -- 
    max lines to display at once 
    local maxindex 
    10 

    -- spacing between lines
    local spacing 
    12


    local index 

    local msgs 
    getnewmessages("Server Log")
    local qtd msgs.count-1
    for i=0,qtd do
       if 
    msgs[qtd-i].type == 19 and msgs[qtd-i].text:find('Loot of 'then
          
          local colorm 
    false
          local l 
    0
          
    for l=1table.getn(warnitems) do
             if 
    msgs[qtd-i].text:find(warnitems[l]) then
                colorm 
    true
                
    break
             
    end
          end
          
    if colorm then
             setfontcolor
    ('red')
          else
             
    setfontcolor('white')
          
    end

          addtext
    (msgs[qtd-i].textworldwin.left+40,worldwin.bottom-(maxindex*spacing)+20+(index*spacing))

          
    index=index+1
          
    if index == maxindex then
            
    break
          
    end
       end
    end 
    Now the HUD is disappearing right after when I got the monster killed ;/

  9. #9
    Focus Group Gryllz's Avatar
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    3,482
    Mentioned
    89 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    236 Post(s)
    Reputation
    342
    Rep Power
    10
    I gonna check this. Hope it causes a little growing cpu usage after some hours of botting.

  10. #10
    Focus Group bofing's Avatar
    Join Date
    Jun 2012
    Location
    Poland
    Posts
    664
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    52 Post(s)
    Reputation
    95
    Rep Power
    6
    Quote Originally Posted by RafiXWPT View Post
    im botting 3 mc's, cpu usage: 45-50%, when I changed to getnewmessages CPU usage: 43-48%, nothing special : d
    Look into your proceses and usage of ibot, I went down from 12% of usage to 0-2% on ibots, maybe you didnt have too much getmessages actions by that it didnt change much for you. I know some ppl will find it useful (mostly the ones that use advanced scripts with so much checkers/alert that's using this getmessages) as it work for me, I didn't say it will work for everyone, some people just got too bad pc or other problems like overheated cpu and other aspects

    also note that getmessages start to make your cpu usage higher after some time of playing when your game chats is full

    Quote Originally Posted by iReaper View Post
    I editted this hotkey of recent loot:

    PHP Code:
    -- you can add more items here
    local warnitems 
    = {'skull staff''blue robe''broken key ring''amber staff''red robe''lunar staff''spider silk''sapphire hammer''boots of haste''war axe''giant sword''chaos mace''dreaded cleaver''steel boots''skull helmet''titan axe''haunted blade''tower shield''amulet of loss'}

    -- 
    max lines to display at once 
    local maxindex 
    10 

    -- spacing between lines
    local spacing 
    12


    local index 

    local msgs 
    getnewmessages("Server Log")
    local qtd msgs.count-1
    for i=0,qtd do
       if 
    msgs[qtd-i].type == 19 and msgs[qtd-i].text:find('Loot of 'then
          
          local colorm 
    false
          local l 
    0
          
    for l=1table.getn(warnitems) do
             if 
    msgs[qtd-i].text:find(warnitems[l]) then
                colorm 
    true
                
    break
             
    end
          end
          
    if colorm then
             setfontcolor
    ('red')
          else
             
    setfontcolor('white')
          
    end

          addtext
    (msgs[qtd-i].textworldwin.left+40,worldwin.bottom-(maxindex*spacing)+20+(index*spacing))

          
    index=index+1
          
    if index == maxindex then
            
    break
          
    end
       end
    end 
    Now the HUD is disappearing right after when I got the monster killed ;/
    okey seems like it doesn't work with HUDs. I got 3 main hotkeys on my scripts that I always use: safe bank, unjust alert, mass res alert. Editing these 3 actions on my 4 tibias make me atleast more than twice less cpu usage

    Anyway if you are having cpu usage problems, you should use huds, lower your tibia fps and all these stuff that was said before
    Last edited by bofing; 09-16-2012 at 06:52 PM.

Posting Permissions

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