Results 1 to 8 of 8

Thread: Open normal door or by Key

  1. #1
    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

    Open normal door or by Key

    Yesterday I searched that action, any I found on forum doesnt work ;o so I writed my own. It was tested, works fine, now Ill give u code.

    First: HUD what shows ID's of item around character (NOT MINE)
    PHP Code:
    setsize(100,150
    --
    setposition(1328000
    setfontcolor("white"

    addtext(toptileitem(posx-1,posy-1,posz),00,30
    addtext(itemname(toptileitem(posx-1,posy-1,posz)),00,40

    addtext(toptileitem(posx,posy-1,posz),60,30
    addtext(itemname(toptileitem(posx,posy-1,posz)),60,40

    addtext(toptileitem(posx+1,posy-1,posz),120,30
    addtext(itemname(toptileitem(posx+1,posy-1,posz)),120,40

    addtext(toptileitem(posx-1,posy,posz),00,55
    addtext(itemname(toptileitem(posx-1,posy-1,posz)),00,65

    addtext(toptileitem(posx,posy,posz),60,55
    addtext(itemname(toptileitem(posx,posy,posz)),60,65

    addtext(toptileitem(posx+1,posy,posz),120,55
    addtext(itemname(toptileitem(posx+1,posy,posz)),120,65

    addtext(toptileitem(posx-1,posy+1,posz),00,80
    addtext(itemname(toptileitem(posx-1,posy-1,posz)),00,90

    addtext(toptileitem(posx,posy+1,posz),60,80
    addtext(itemname(toptileitem(posx,posy,posz)),60,90

    addtext(toptileitem(posx+1,posy+1,posz),120,80
    addtext(itemname(toptileitem(posx+1,posy,posz)),120,90
    and action for opendoor: (MINE )
    PHP Code:
    -- OpenDoorAction by RafiXWPT
    local DoorX 
    -- Door X position
    local DoorY 
    -- Door Y position
    local KeyId 
    -- If you dont need keysimply left "0" here
    local ClosedDoorId 
    -- Closed Door ID
    local ClosedByKeyDoorId 
    -- Closed by Key Door ID, If you dont know that IDsimply left "0" here

    wait
    (1000)
    -- If 
    Door is closed by Key
    if toptileitem(DoorX,DoorY,posz) == ClosedByKeyDoorId then
    wait
    (500,750)
         
    useitemon(KeyIdDoorX,DoorY,posz)
    wait(500,750)
    -- If 
    Door is just closed
    elseif toptileitem(DoorX,DoorY,posz) == ClosedDoorId then
    wait
    (500,750)
         
    useitem(ClosedDoorIdDoorX,DoorY,posz)
    wait(500,750)
    end
    wait
    (1000
    Example:
    PHP Code:
    -- OpenDoorAction by RafiXWPT
    local DoorX 
    32191
    local DoorY 
    32439
    local KeyId 
    0
    local ClosedDoorId 
    1632
    local ClosedByKeyDoorId 
    0

    wait
    (1000)
    if 
    toptileitem(DoorX,DoorY,posz) == ClosedByKeyDoorId then
    wait
    (500,750)
         
    useitemon(KeyIdDoorX,DoorY,posz)
    wait(500,750)
    elseif 
    toptileitem(DoorX,DoorY,posz) == ClosedDoorId then
    wait
    (500,750)
         
    useitem(ClosedDoorIdDoorX,DoorY,posz)
    wait(500,750)
    end
    wait
    (1000
    enjoy everyone who search it!
    Last edited by RafiXWPT; 07-28-2012 at 05:14 PM.

  2. #2
    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
    Nice stuff, ill come in quite handy since a lot of people script in terrible door opening actions.

    I don't understand why (not just here) people put so many waits around things. Like the 1000 wait at the start and end of this script is completely pointless.

  3. #3
    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
    waits in actions is important, bot have more time to perform another action, if you want to create action without any wait you must be prepared to missing some actions by bot (tibia exhaust)

  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
    Quote Originally Posted by RafiXWPT View Post
    waits in actions is important, bot have more time to perform another action, if you want to create action without any wait you must be prepared to missing some actions by bot (tibia exhaust)
    I know how to write scripts. But the first wait(1000) and the last wait(1000) are pointless in this script. All it does is waste time.

    You don't get exhausted from just starting an action.

    Persistent actions already has a "spam rate". Way points have their own short delays before moving to the next script, and in this case the first function is to check the top id, which, if already on seen, will already have been returned so will take less than 1ms for the bot to find said value.

    Putting a wait(1000) at the very start and end is completely pointless.
    Last edited by pink_panther; 07-30-2012 at 09:19 AM.

  5. #5
    Normal User
    Join Date
    Aug 2012
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    thanks u are the best!

  6. #6
    iBot User
    Join Date
    Jun 2012
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    24
    Rep Power
    5
    does anyone knows how i can get id from keys?
    i need id for
    copper key (Key:3802)

  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
    put key on ground and use hud to show id items around :d

  8. #8
    Normal User
    Join Date
    Apr 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    from me this scrypt not working... ;/

Posting Permissions

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