Results 1 to 7 of 7

Thread: need help with pathfindings!

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

    need help with pathfindings!

    hello! first of all i want to thank the community because you answered my last doubts. so you are great

    and now one question before i start:
    Is it okay that i post here? should i post in support forum?

    ok. now my problem:

    actually is not a problem, but i dont understand well how pathfinding works. in one of my last posts i was asking someone to help me because my bot kept falling in a shovel hole and lost his way so logged out after 15 min. someone told to me use "pathfindings" near the hole. i did. i think it didnt fall again but im not completely sure if he is gonna walk down there or not, so here is my question (please take that hole thing just as an example, dont centre your response into that):

    how does the pathfinding function work?
    what does it exactly do? how am i supposed to use it?

    if you had a tutorial in hand it would be helpful. but i hope you can also answer this simple questions please

    Thanks to you all, i feel as if i was bothering you too much, but i wanna improve with my scripting skills! i keep reading tutorials and other ppl scripts though.
    well, hope you can answer this to me, bye and thanks!
    Last edited by Stinson Awesome; 03-10-2013 at 09:33 PM.

  2. #2
    iBot User
    Join Date
    May 2012
    Location
    USA
    Posts
    153
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    2 Post(s)
    Reputation
    16
    Rep Power
    5
    go to where the hole is make a special area and put consideredby as ALL and for your dimensions use this hud, it will show you where the special areas are so u can determine ur dimensions

    HUD FOR SPECIAL AREA

    Code:
    SpecialAreas = {"NewArea0","NewArea1","NewArea2","NewArea3"}
    ShowNames=true    --Show SpecialAreas Names? (true/false)
    FontSize = 10
    
    -- ### Colors ###
    NameColor=rgbcolor(0,191,255)
    TargetColor=rgbcolor(250,15,15)
    CavebotColor=rgbcolor(15,250,75)
    AllColor=rgbcolor(255,225,0)
    NoneColor=rgbcolor(255,255,255)
    
    -- ### DO NOT EDIT BELOW ###
    local function addtextshadow(text, color, shadowcolor, xpos, ypos)
        setfontcolor(shadowcolor)
        addtext(text, xpos+1, ypos+1)
        setfontcolor(color)
        addtext(text, xpos, ypos)
    end
    function string:split(sep)
            local sep, fields = sep or ":", {}
            local pattern = string.format("([^%s]+)", sep)
            self:gsub(pattern, function(c) fields[#fields+1] = c end)
            return fields
    end
    
    setfontstyle("Trebuchet MS",FontSize,"B")
    
    for sa=1, table.getn(SpecialAreas) do
        Considered = getsettings("Settings\\CaveBot\\Pathfinding\\SpecialAreas\\"..SpecialAreas[sa].."\\ConsideredBy")
        if Considered~="" then
        if Considered == "Target" then FontColor=TargetColor
        elseif Considered == "Cavebot" then FontColor=CavebotColor
        elseif Considered == "All" then FontColor=AllColor
        else FontColor=NoneColor
        end
        Coordinates=getsettings("Settings\\CaveBot\\Pathfinding\\SpecialAreas\\"..SpecialAreas[sa].."\\Coordinates"):split(" ")
        Dimensions=getsettings("Settings\\CaveBot\\Pathfinding\\SpecialAreas\\"..SpecialAreas[sa].."\\Dimensions"):split(" ")
        lx=15
        ly=15
        if string.upper(Coordinates[3])==string.upper(posz) and posx>=math.min(Coordinates[1], Coordinates[1]+Dimensions[1])-lx and posx<=math.max(Coordinates[1], Coordinates[1]+Dimensions[1])+lx and posy>=math.min(Coordinates[2], Coordinates[2]+Dimensions[2])-ly and posy<=math.max(Coordinates[2], Coordinates[2]+Dimensions[2])+ly then
            ux = worldwin.width/15
            uy = worldwin.height/11
            i=Coordinates[1]-posx
            j=Coordinates[2]-posy
            setfontcolor(FontColor)
            for dx=math.min(0,Dimensions[1]),math.max(0,Dimensions[1])-1 do
                for dy=math.min(0,Dimensions[2]),math.max(0,Dimensions[2])-1 do
                    for s=1,worldwin.width/90 do
                        if dy==math.min(0,Dimensions[2]) then
                            addtextshadow("_", FontColor, rgbcolor(1,1,1), (i+15/2+dx)*ux+3+s*2+worldwin.left, (j+5+dy)*uy+13)
                            addtextshadow("_", FontColor, rgbcolor(1,1,1), (i+15/2+dx)*ux+3-s*2+worldwin.left, (j+5+dy)*uy+13)
                        end
                        addtextshadow("_", FontColor, rgbcolor(1,1,1), (i+15/2+dx)*ux+3+s*2+worldwin.left, (j+6+dy)*uy+13)
                        addtextshadow("_", FontColor, rgbcolor(1,1,1), (i+15/2+dx)*ux+3-s*2+worldwin.left, (j+6+dy)*uy+13)
                    end
                    for s=1,worldwin.height/66 do
                        if dx==math.min(0,Dimensions[1]) then
                            addtextshadow("|", FontColor, rgbcolor(1,1,1), (i+7+dx)*ux+3+worldwin.left, (j+11/2+dy)*uy+18+s*2)
                            addtextshadow("|", FontColor, rgbcolor(1,1,1), (i+7+dx)*ux+3+worldwin.left, (j+11/2+dy)*uy+18-s*2)
                        end
                        addtextshadow("|", FontColor, rgbcolor(1,1,1), (i+8+dx)*ux+3+worldwin.left, (j+11/2+dy)*uy+18+s*2)
                        addtextshadow("|", FontColor, rgbcolor(1,1,1), (i+8+dx)*ux+3+worldwin.left, (j+11/2+dy)*uy+18-s*2)
                    end
                    if ShowNames then
                        addtextshadow(string.upper(Considered), FontColor, rgbcolor(1,1,1), ux*(i+7.05+dx)+worldwin.left+0.5*FontSize*(ux/FontSize-string.len(Considered)+2), uy*(j+5.7+dy)+20)
                        addtextshadow(SpecialAreas[sa], NameColor, rgbcolor(1,1,1), ux*(i+7.1+dx)+worldwin.left+0.5*FontSize*(ux/FontSize-string.len(SpecialAreas[sa])+2), uy*(j+5.3+dy)+20)
                    else
                        addtextshadow(string.upper(Considered), FontColor, rgbcolor(1,1,1), ux*(i+7.05+dx)+worldwin.left+0.5*FontSize*(ux/FontSize-string.len(Considered)+2), uy*(j+5.5+dy)+20)
                    end
                end
            end
        end
        end
    end
    credits to Balkarynd for hud

  3. #3
    Normal User
    Join Date
    Aug 2012
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    Last edited by Stinson Awesome; 03-11-2013 at 03:28 AM.

  4. #4
    iBot User
    Join Date
    May 2012
    Location
    USA
    Posts
    153
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    2 Post(s)
    Reputation
    16
    Rep Power
    5
    using the hud will help you adjust to see the sqm ur char will avoid
    Last edited by ICheat; 03-12-2013 at 05:56 PM.

  5. #5
    iBot User Noxuos's Avatar
    Join Date
    Mar 2012
    Location
    iBot Forums
    Posts
    852
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    167
    Rep Power
    7
    123456789123456789

    Script Voc Video Of Script 100% AFK
    [300+]Zao Walls Main Floor And Floor Up Ava SD and Spell Version ED|MS Video On TibiaCast/YouTube
    [200+]Deeplings Stage 1 West Side ED|MS|RP|EK Video On TibiaCast/YouTube
    [150+]Yalahar Bog Raiders Optional Nightmare And Destroyer Elite Knight Video On TibiaCast/YouTube
    •Noxuos Scripts Screen Shot Project Click Here! •Sell 340 RP Open-PVP: Transferable: Pm With Offers Noxuos Scripts Character Shop Click Here

    •New Poll Which voc do you want to see more scripts of? Check out my thread to vote •Sell 264 ED PvP: Transferable: 80 voucher days! •Accepting Tibia Cash On All New Scripts



  6. #6
    iBot User
    Join Date
    May 2012
    Location
    USA
    Posts
    153
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    2 Post(s)
    Reputation
    16
    Rep Power
    5
    same thing i posted above ;o

  7. #7
    iBot User Noxuos's Avatar
    Join Date
    Mar 2012
    Location
    iBot Forums
    Posts
    852
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    167
    Rep Power
    7
    Quote Originally Posted by ICheat View Post
    same thing i posted above ;o
    true, but he can read more about who made it and rep him...etc
    123456789123456789

    Script Voc Video Of Script 100% AFK
    [300+]Zao Walls Main Floor And Floor Up Ava SD and Spell Version ED|MS Video On TibiaCast/YouTube
    [200+]Deeplings Stage 1 West Side ED|MS|RP|EK Video On TibiaCast/YouTube
    [150+]Yalahar Bog Raiders Optional Nightmare And Destroyer Elite Knight Video On TibiaCast/YouTube
    •Noxuos Scripts Screen Shot Project Click Here! •Sell 340 RP Open-PVP: Transferable: Pm With Offers Noxuos Scripts Character Shop Click Here

    •New Poll Which voc do you want to see more scripts of? Check out my thread to vote •Sell 264 ED PvP: Transferable: 80 voucher days! •Accepting Tibia Cash On All New Scripts



Posting Permissions

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