Results 1 to 5 of 5

Thread: How to take value of msg from default channel or balance surce.

  1. #1
    zami84's Avatar
    Join Date
    May 2012
    Posts
    316
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    48
    Rep Power
    5

    How to take value of msg from default channel or balance surce.

    Hiho,
    how to take value from message on default channel?
    ex.
    xxx: abd bcds 8900!

    how to take 8900?

    or some1 have surce code of balance function?

  2. #2
    iBot User
    Join Date
    Aug 2012
    Posts
    805
    Mentioned
    18 Post(s)
    Tagged
    2 Thread(s)
    Quoted
    38 Post(s)
    Reputation
    180
    Rep Power
    7
    Lua Code:
    local msgs = getnewmessages("Local Chat")  
    local msg = msgs.count-1  
    local message = "aa"  
     
    for i = 0, msg do  
        if msgs[i].text:find(message) then  
            local MyBalance = string.match(msgs[i].text, "%d%d%d%d%d")  
    print(MyBalance)
        end  
    end


    but this return correct value only if after aa is 5 digits so between 10000-99999

  3. #3
    zami84's Avatar
    Join Date
    May 2012
    Posts
    316
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    48
    Rep Power
    5
    I think i will help me a lot. :P
    rep +

  4. #4
    zami84's Avatar
    Join Date
    May 2012
    Posts
    316
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    1 Post(s)
    Reputation
    48
    Rep Power
    5
    I think i will help me a lot. :P


    i would like to give you a Rep+ but i cant

  5. #5
    iBot User pink_panther's Avatar
    Join Date
    May 2012
    Location
    Australia
    Posts
    4,075
    Mentioned
    49 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    178 Post(s)
    Reputation
    309
    Rep Power
    10
    ohhhhh myyyy goooooooooooood

    just use "balance"


    balance [int]: Represent last balance number reported from a NPC.

    Lua Code:
    local msgs = getnewmessages("Local Chat")  
    local msg = msgs.count-1  
    local message = "aa"  
     
    for i = 0, msg do  
        if msgs[i].text:find(message) then  
            local MyBalance = string.match(msgs[i].text, "%d%d%d%d%d")  
    print(MyBalance)
        end  
    end


    but this return correct value only if after aa is 5 digits so between 10000-99999

    use $d+

    but since it would pull the time, better to use &d&d&d+ do its any digit over 3 numbers.

    however, if you're doing it for balance mount, just use balance like i said.
    Last edited by pink_panther; 02-16-2014 at 11:45 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
  •