Results 1 to 3 of 3

Thread: [doubt] Attacking Stalker with firefield rune!

  1. #1
    Normal User
    Join Date
    Jul 2012
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5

    [doubt] Attacking Stalker with firefield rune!

    Hello!
    I have a script to attack hit stalker when its hit me, by getting the server log messages and finding the name "Stalker" on then. But, i have a char level under 30 and cant use GFB runes, then i wanna know how modify the script to thrown a firefield in the squares arround me, starting in the square (x-1, y-1,z) then completing the "circle" until the stalker is dead.
    I have this script:

    local msgs = getmessages("Server Log")
    local qtd = msgs.count-1
    local x = posx
    local y = posy
    local z = posz

    for i=0,qtd do
    if (msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) then
    useitemon(firefield rune ID, x-1, y-1, z)
    end
    end
    If anyone can explain me how its work, step by step, i think i can modify it by my self. I don't understand somethings, like how that "for" work. I need understand the values of the functions and how it work.

    Thanks!

  2. #2
    Normal User
    Join Date
    Jul 2012
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    Well...i done something, can anyone check, for errors, i program in C/C++ language and don't know some syntax of ibot programming, then if anyone can see my code...
    The code: It get the server log mensage and do somethings: Find the sentence "due to an attack by a stalker." in the last mensage, check if have anyplayer on screen and if have any stalker arround me (if have i don't need shoot FF rune xD), if have fire field in the tile (i don't wanna shoot FF rune in a place where it has a firefield) and if the tile is shooteable (if don't have a wall, for exemple). Then, if all the conditions are okay, it shoot the FF rune on the tile. Please, check if it will work.

    local msgs = getmessages("Server Log")
    local qtd = msgs.count-1
    local x = posx
    local y = posy
    local z = posz
    local FIRE_FIELD_ID = 1337
    local FF_RUNE_ID = 3188

    for i=0,qtd do
    if (msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x-1,y+1,z) ~= FIRE_FIELD_ID) and (isshootable(x-1, y+1, z) == true) then
    useitemon(FF_RUNE_ID, x-1, y+1, z)
    else (msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x,y+1,z) ~= FIRE_FIELD_ID) and (isshootable(x, y+1, z) == true) then
    useitemon(FF_RUNE_ID, x, y+1, z)
    else (msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x+1,y+1,z) ~= FIRE_FIELD_ID) and (isshootable(x+1, y+1, z) == true) then
    useitemon(FF_RUNE_ID, x+1, y+1, z)
    else (msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x-1,y,z) ~= FIRE_FIELD_ID) and (isshootable(x-1, y, z) == true) then
    useitemon(FF_RUNE_ID, x-1, y, z)
    else (msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x-1,y-1,z) ~= FIRE_FIELD_ID) and (isshootable(x-1, y-1, z) == true) then
    useitemon(FF_RUNE_ID, x-1, y-1, z)
    else (msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x+1,y,z) ~= FIRE_FIELD_ID) and (isshootable(x+1, y, z) == true) then
    useitemon(FF_RUNE_ID, x+1, y, z)
    else (msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x+1,y-1,z) ~= FIRE_FIELD_ID) and (isshootable(x+1, y-1, z) == true) then
    useitemon(FF_RUNE_ID, x+1, y-1, z)
    else (msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x,y-1,z) ~= FIRE_FIELD_ID) and (isshootable(x, y-1, z) == true) then
    useitemon(FF_RUNE_ID, x, y-1, z)
    end
    end
    I need to put end, after a else? (i put a end for the "for" function and a end to "if" function. I can use else? I need use "true" or only true (without quotation mark)? I can do the math inside the function, like "isshootable(x, y-1, z)"?
    Last edited by Ameno; 12-02-2012 at 03:22 PM.

  3. #3
    Normal User
    Join Date
    Jul 2012
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    PHP Code:
    local msgs getmessages("Server Log")
    local qtd msgs.count-1
    local x 
    posx
    local y 
    posy
    local z 
    posz
    local FIRE_FIELD_ID 
    1337
    local FF_RUNE_ID 
    3188

    for i=0,qtd do
    if (
    msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x-1,y+1,z) ~= FIRE_FIELD_ID) and (isshootable(x-1,y+1,z) == truethen
    useitemon
    (FF_RUNE_ID,x-1,y+1,z)
    wait(500,1000)

    elseif (
    msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x,y+1,z) ~= FIRE_FIELD_ID) and (isshootable(x,y+1,z) == truethen
    useitemon
    (FF_RUNE_ID,x,y+1,z)
    wait(500,1000)

    elseif (
    msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x+1,y+1,z) ~= FIRE_FIELD_ID) and (isshootable(x+1,y+1,z) == truethen
    useitemon
    (FF_RUNE_ID,x+1,y+1,z)
    wait(500,1000)

    elseif (
    msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x-1,y,z) ~= FIRE_FIELD_ID) and (isshootable(x-1,y,z) == truethen
    useitemon
    (FF_RUNE_ID,x-1,y,z)
    wait(500,1000)
                    
    elseif (
    msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x-1,y-1,z) ~= FIRE_FIELD_ID) and (isshootable(x-1,y-1,z) == truethen
    useitemon
    (FF_RUNE_ID,x-1,y-1,z)
    wait(500,1000)
                            
    elseif (
    msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x+1,y,z) ~= FIRE_FIELD_ID) and (isshootable(x+1,y,z) == truethen
    useitemon
    (FF_RUNE_ID,x+1,y,z)
    wait(500,1000)
                                
    elseif (
    msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x+1,y-1,z) ~= FIRE_FIELD_ID) and (isshootable(x+1,y-1,z) == truethen
    useitemon
    (FF_RUNE_ID,x+1,y-1,z)
    wait(500,1000)
                                    
    elseif (
    msgs[qtd].text:find("due to an attack by a stalker.")) and (paround() == 0) and (maround(3,"Stalker") == 0) and toptileid(x,y-1,z) ~= FIRE_FIELD_ID) and (isshootable(x,y-1,z) == truethen
    useitemon
    (FF_RUNE_ID,x,y-1,z)
    wait(500,1000)
        
    end
    end 
    What is the error with the code? I tested now it, but didn't work.

Posting Permissions

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