Results 1 to 7 of 7

Thread: Place X into a string

  1. #1
    Banned
    Join Date
    Jul 2012
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    0

    Place X into a string

    Id like to place a letter into a string of letters so if i had like
    Code:
    String = 'hello'
    I would want the new string to be
    Code:
    String = 'hexllo

    i need to be able to manipulate a string for one of my scripts is it possible to do that useing string.format() ???

  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
    I beleieve its possible, Im doing these things in C++ but I don't know what function I should use here, tomorrow when Ill be in home Ill search, maybe I will be able to reply in your threat and help you

  3. #3
    Banned
    Join Date
    Jul 2012
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by RafiXWPT View Post
    I beleieve its possible, Im doing these things in C++ but I don't know what function I should use here, tomorrow when Ill be in home Ill search, maybe I will be able to reply in your threat and help you
    thank you i also now some c++ and could probley do it in that code but in the bots code its a little harder for me :/
    repped in advance

  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
    yeah, done here you are:
    PHP Code:
    local s "hello"
    string.sub(s13)
    string.sub(s45)
    wait(1000)
    say(.."x".. b
    16:31 Backan Destroyer [253]: helxlo
    http://screenshooter.net/1162658/rpdugns <- Screen

    and now I have something better, take that ;D!
    PHP Code:
    local s "ILoveIBot"
    len string.len(s)
    math.random(1len)
    string.sub(s1x)
    string.sub(sx+1len)
    wait(1000)
    say(.."x".. b
    16:40 Backan Destroyer [253]: ILoveIxBot
    16:40 Backan Destroyer [253]: ILovexIBot
    16:40 Backan Destroyer [253]: IxLoveIBot
    Last edited by RafiXWPT; 01-03-2013 at 12:41 PM.

  5. #5
    Banned
    Join Date
    Jul 2012
    Posts
    205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by RafiXWPT View Post
    yeah, done here you are:
    PHP Code:
    local s "hello"
    string.sub(s13)
    string.sub(s45)
    wait(1000)
    say(.."x".. b


    http://screenshooter.net/1162658/rpdugns <- Screen
    thanks that works is there any chance you could accommodate for differnt length strings? i dont now if theres a varriable or function the returns the length of a string...

    once agin thanks really appreciate it
    Last edited by Glitch; 01-03-2013 at 12:49 PM.

  6. #6
    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
    yeah check that second option it will take len of word and put X in random place

  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
    use what I wrote up:
    PHP Code:
    local s "ILoveIBot" -- any word
    len 
    string.len(s)
    math.random(1len)
    string.sub(s1x)
    string.sub(sx+1len)
    wait(1000)
    say(.."x".. b
    16:40 Backan Destroyer [253]: ILoveIxBot
    16:40 Backan Destroyer [253]: ILovexIBot
    16:40 Backan Destroyer [253]: IxLoveIBot
    u can put any word, that action will take lenght of this world and put X in random place
    Last edited by RafiXWPT; 01-03-2013 at 12:53 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
  •