PDA

View Full Version : Put on Amulet script?



Xparn
01-22-2013, 08:12 AM
How can i make a script that put on terra amulet's .. ?

i tried;


local AmuletID = 814

while true do
if Self.Amulet().id == 0 then
Self.Equip(AmuletID, "Amulet")
end
wait(100,600)
end


Didn't work... it's says wrong id "amulet'"

Xparn
01-22-2013, 09:04 AM
while (true) do
local BACKPACK_NAME = "Backpack"
local AMULET_NAME = "Garlic Necklace"

--!!!!!!!!!!!!!!!!!!!!!!!
--!!!DO NOT EDIT BELOW!!!
--!!!!!!!!!!!!!!!!!!!!!!!

local BACKPACK = Container.GetByName(BACKPACK_NAME)
if (Self.Amulet().id ~= Item.GetID(AMULET_NAME)) then
for SPOT = 0, BACKPACK:ItemCount() do
local Amulet = BACKPACK:GetItemData(SPOT)
if (Amulet.id == Item.GetID(AMULET_NAME)) then
BACKPACK:MoveItemToEquipment(SPOT, "amulet")
end
end
end
wait(100)
end


Is it not possible just do drag from whatever backpack you have life rings in?

soul4soul
01-22-2013, 02:07 PM
Is it not possible just do drag from whatever backpack you have life rings in?
it is. I think you need to make this lowercase. "Amulet" -> "amulet". You can use item names instead of ids too. local Amulet = "garlic necklace" and you need to change this line to match the variable Self.Equip(Amulet, "amulet"). you might want to add a check to make sure you have ammys left in your backpack Self.ItemCount(Amulet) > 0.

soul4soul
01-22-2013, 03:03 PM
If you dont care what backpack the ring is coming from you dont need to loop through backpacks and their contents to move and item to your EQ. for example this is my dwarven ring script. The reason I used ~= dwarven ring is because if someone using my script was already wearing a ring it would be kicked off. with Self.Amulet().id == 0 if you wearing an amulet it wont get kicked off for a terra.

while(true)do
if Self.Ring().id ~= Item.GetRingActiveID(Item.GetID("dwarven ring")) and (Self.ItemCount("dwarven ring") > 0)then
Self.Equip("dwarven ring", "ring")
end

sleep(1000)
end

Xparn
01-23-2013, 12:24 PM
Thanks for the help guys!