XenoBot Forums - Powered by vBulletin

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [REQUEST] If ghost on screen change weapon (for ek)

  1. #1
    Storm70's Avatar
    Join Date
    Jun 2014
    Location
    United States
    Posts
    117
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Question [REQUEST] If ghost on screen change weapon (for ek)

    As topic says I'm really in the need of a weapon changer lua. I had it before I deleted xenobot to download binary and didn't save script in notepad, wondering if someone still has a script to share with me, or has free time to make one and share!
    If ghost on screen change current weapon (mystic blade, ID=7384), to weapon in 1st backpack which is (fire sword, ID=3281), and if no ghost on screen re-equip mystic blade. I already have spent some time trying to create it but I don't think I'm making any progress.

  2. #2
    Storm70's Avatar
    Join Date
    Jun 2014
    Location
    United States
    Posts
    117
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    bump
    >short<

  3. #3
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    This will switch to a Fire Sword if you're targeting a Ghost and then switch back again whenever you're not targeting a Ghost.

    lua code:

    local specialMonsters = {"Ghost"}
    local defaultWeapon = "Mystic Blade"
    local specialWeapon = "Fire Sword"

    -----------------------------------------------
    -----------------------------------------------
    -----------------------------------------------

    defaultWeapon = Item.GetID(defaultWeapon)
    specialWeapon = Item.GetID(specialWeapon)

    Module("Weapon changer", function(self)
    local c = Creature(Self.TargetID())
    local useSpecial = c and table.find(specialMonsters, c:Name())
    if useSpecial and Self.Weapon().id ~= specialWeapon then
    Self.Equip(specialWeapon, "weapon")
    self:Delay(5000)
    elseif not useSpecial and Self.Weapon().id ~= defaultWeapon then
    Self.Equip(defaultWeapon, "weapon")
    self:Delay(5000)
    end
    end)
    Last edited by shadowart; 12-07-2015 at 02:30 PM.

  4. #4
    Storm70's Avatar
    Join Date
    Jun 2014
    Location
    United States
    Posts
    117
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    This will switch to a Fire Sword if you're targeting a Ghost and then switch back again whenever you're not targeting a Ghost.

    lua code:

    local specialMonsters = {"Ghost"}
    local defaultWeapon = "Mystic Blade"
    local specialWeapon = "Fire Sword"

    -----------------------------------------------
    -----------------------------------------------
    -----------------------------------------------

    defaultWeapon = Item.GetID(defaultWeapon)
    specialWeapon = Item.GetID(specialWeapon)

    Module("Weapon changer", function(self)
    local c = Creature(Self.TargetID())
    local useSpecial = c and table.find(specialMonsters, c:Name())
    if useSpecial and Self.Weapon().id ~= specialWeapon then
    Self.Equip(specialWeapon, "weapon")
    elseif not useSpecial and Self.Weapon().id ~= defaultWeapon then
    Self.Equip(defaultWeapon, "weapon")
    end
    self:Delay(1000)
    end)


    Download link in-case you get the copy problem again:
    https://www.dropbox.com/s/6wxz2m0567...tcher.lua?dl=1
    Thank you mate.
    Cheers, appreciate the download link! Sorry late reply!

  5. #5

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    This will switch to a Fire Sword if you're targeting a Ghost and then switch back again whenever you're not targeting a Ghost.

    lua code:

    local specialMonsters = {"Ghost"}
    local defaultWeapon = "Mystic Blade"
    local specialWeapon = "Fire Sword"

    -----------------------------------------------
    -----------------------------------------------
    -----------------------------------------------

    defaultWeapon = Item.GetID(defaultWeapon)
    specialWeapon = Item.GetID(specialWeapon)

    Module("Weapon changer", function(self)
    local c = Creature(Self.TargetID())
    local useSpecial = c and table.find(specialMonsters, c:Name())
    if useSpecial and Self.Weapon().id ~= specialWeapon then
    Self.Equip(specialWeapon, "weapon")
    elseif not useSpecial and Self.Weapon().id ~= defaultWeapon then
    Self.Equip(defaultWeapon, "weapon")
    end
    self:Delay(1000)
    end)


    Download link in-case you get the copy problem again:
    https://www.dropbox.com/s/6wxz2m0567...tcher.lua?dl=1

    My bot died because of the script hehe The bot when he gets stuck by ghost, he stop and start attack all the time so he dont have time to kill the monster becasue he spam change weapon = death after a while

  6. #6
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by jollebollen View Post
    My bot died because of the script hehe The bot when he gets stuck by ghost, he stop and start attack all the time so he dont have time to kill the monster becasue he spam change weapon = death after a while
    Runs fine on my end. You have some issue on your end. The onyl time it will switch is if you stop targeting the ghost, and unless you have wierd as fuck settings it will only stop attacking the ghost if it dies (or moves out of the way for some reason - but then you don't need to kill it anyways).
    Last edited by shadowart; 12-07-2015 at 01:27 AM.

  7. #7

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    Runs fine on my end. You have some issue on your end. The onyl time it will switch is if you stop targeting the ghost, and unless you have wierd as fuck settings it will only stop attacking the ghost if it dies (or moves out of the way for some reason - but then you don't need to kill it anyways).
    No I have just attack if stuck. The bot sets alarm walker stuck walker stuck, and he is surrounded by 8 ghosts. So he attack and stop attack the ghost all the time so he doesn't have time to take up the fire sword. Btw is it possible to add more than one monster to the script?

  8. #8
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    Why teh fuck would he stop attacking a ghost? That's not how if-stuck targeting works. Is something summoning new ghosts? And yeah, just add another name to the specialMonsters list.

  9. #9

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    Why teh fuck would he stop attacking a ghost? That's not how if-stuck targeting works. Is something summoning new ghosts? And yeah, just add another name to the specialMonsters list.
    No he is hunting in drefia. He stop and start attack only when he is in a full trap. What exactly do you mean? Where do I put it in the lua script and how, with puncuation etc

  10. #10

    Join Date
    Nov 2012
    Posts
    332
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)
    I noticed the attack and unattack only happends if you are in a full trap and cant move a single SQM at any direction. If something is just blocking your path it's no problem :P

Posting Permissions

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