Results 1 to 4 of 4

Thread: ASk ABOUT CONVERT STRING TO INT

  1. #1
    iBot User just71aa's Avatar
    Join Date
    Apr 2012
    Posts
    74
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    19 Post(s)
    Reputation
    20
    Rep Power
    5

    ASk ABOUT CONVERT STRING TO INT

    i mean
    local x = "22222,22222,22"

    toptileitem(int.format(x)) <- not works probably all is wrong idk how to convert it

  2. #2
    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
    Quote Originally Posted by just71aa View Post
    i mean
    local x = "22222,22222,22"

    toptileitem(int.format(x)) <- not works probably all is wrong idk how to convert it
    You are doing it wrong...

    Lua Code:
    local x,y,z = 22222, 22222, 22
    if toptileitem(x,y,z) == "something" then
         "do something"
    else
         "do something else"
    end


    about string -> int, there is function in LUA Documentaction.
    Lua Code:
    a = "10"
    x = tonumber(a)
    Last edited by RafiXWPT; 10-28-2014 at 08:30 AM.

  3. #3
    Focus Group Targets's Avatar
    Join Date
    Nov 2013
    Location
    PoA - Brazil
    Posts
    456
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    48 Post(s)
    Reputation
    109
    Rep Power
    5
    Lua Code:
     
    Local String = "13232"
    Local Integer = String + 0


    Working fine to me (Using it to do Monster Counters)



  4. #4
    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
    Umm...

    local exampleString = "123"
    local exampleInt = 123

    but in this case just do what RafiXWPT said. You're just doing it wrong.

Posting Permissions

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