Log in

View Full Version : Execute Scripter on hotkey or keyword?



sesek
03-10-2017, 08:29 PM
Its possible to execute script on hotkey or on say ?

ctmwnrqlo
03-11-2017, 10:38 PM
nope :/

HjugO
03-11-2017, 11:40 PM
Its possible to execute script on hotkey or on say ?

Yes, it is possible. You should use module:Start() and hotkey script included in example folder in XenoBot direcotry.

sesek
03-12-2017, 12:30 AM
Yes, it is possible. You should use module:Start() and hotkey script included in example folder in XenoBot direcotry.
not really understand ? how should i use this module ? can u give exampl,e ?

HjugO
03-12-2017, 10:08 AM
not really understand ? how should i use this module ? can u give exampl,e ?


CONFIG = {
--ITEM NAME, AMOUNT TO DROP
TRASH_ITEMS = {{"gold coin", 2}, {"worm", 2}, {"brown mushroom", 2}}
}

function onSpeak(CHANNEL, message)
CHANNEL:SendYellowMessage("You", message)
if (message == "/start") then
DropItemsModule:Start()
CHANNEL:SendOrangeMessage("[XENOBOT]", "TrashItems - ON!")
elseif (message == "/stop") then
DropItemsModule:Stop()
CHANNEL:SendOrangeMessage("[XENOBOT]", "TrashItems - OFF.")
end
end

CHANNEL = Channel.Open("[XENOBOT]", onSpeak, onClose)
CHANNEL:SendYellowMessage("[XENOBOT]", "Welcome!")

DropItemsModule = Module("MAIN MODULE", function(moduleObject)
for k, v in pairs(CONFIG.TRASH_ITEMS) do
if Map.GetTopMoveItem(Self.Position().x, Self.Position().y, Self.Position().z).id ~= Item.GetID(v[1]) then
Self.DropItem(Self.Position().x, Self.Position().y, Self.Position().z, v[1], v[2])
end
end
end, false)

Study this code, look at module name, Start() / Stop() fuunction. Good luck!

sesek
03-12-2017, 07:55 PM
CONFIG = {
--ITEM NAME, AMOUNT TO DROP
TRASH_ITEMS = {{"gold coin", 2}, {"worm", 2}, {"brown mushroom", 2}}
}

function onSpeak(CHANNEL, message)
CHANNEL:SendYellowMessage("You", message)
if (message == "/start") then
DropItemsModule:Start()
CHANNEL:SendOrangeMessage("[XENOBOT]", "TrashItems - ON!")
elseif (message == "/stop") then
DropItemsModule:Stop()
CHANNEL:SendOrangeMessage("[XENOBOT]", "TrashItems - OFF.")
end
end

CHANNEL = Channel.Open("[XENOBOT]", onSpeak, onClose)
CHANNEL:SendYellowMessage("[XENOBOT]", "Welcome!")

DropItemsModule = Module("MAIN MODULE", function(moduleObject)
for k, v in pairs(CONFIG.TRASH_ITEMS) do
if Map.GetTopMoveItem(Self.Position().x, Self.Position().y, Self.Position().z).id ~= Item.GetID(v[1]) then
Self.DropItem(Self.Position().x, Self.Position().y, Self.Position().z, v[1], v[2])
end
end
end, false)

Study this code, look at module name, Start() / Stop() fuunction. Good luck!

i love u so ****** much