<?xml version=”1.0″ encoding=”iso-8859-1″?>
<!DOCTYPE muclient>
<!– Saved on Friday, August 14, 2015, 5:50 AM –>
<!– MuClient version 4.98 –>
<!– Plugin “Galabans_vlad_autoloot” generated by Plugin Wizard –>
<muclient>
<plugin
name=”Galabans_vlad_autoloot”
author=”Galaban”
id=”014753ac2e3487dd1af38544″
language=”Lua”
purpose=”Turn off autoloot whenever you are in Vlad”
save_state=”y”
date_written=”2015-08-14 05:48:20″
requires=”4.80″
version=”1.0″
>
<description trim=”y”>
<![CDATA[
This is a simple plugin that will turn off autoloot whenever you are in Vlad. When you leave vlad, it turns it back on.
]]>
</description>
</plugin>
<!– Get our standard constants –>
<include name=”constants.lua”/>
<!– Triggers –>
<triggers>
<trigger
enabled=”y”
match=”You will now autoloot items from corpses.”
sequence=”100″
send_to=”12″
>
<send>setAutoloot(true)</send>
</trigger>
<trigger
enabled=”y”
match=”You will no longer autoloot items from corpses.”
sequence=”100″
send_to=”12″
>
<send>setAutoloot(false)</send>
</trigger>
</triggers>
<!– Script –>
<script>
<![CDATA[
require “gmcphelper”
function OnPluginBroadcast (msg, id, name, text)
if (id == “3e7dedbe37e44942dd46d264”) then — gmcphandler
if (text == “room.info”) then
res, gmcparg = CallPlugin(“3e7dedbe37e44942dd46d264″,”gmcpval”,”room.info”)
luastmt = “gmcpdata = ” .. gmcparg
assert (loadstring (luastmt or “”)) ()
got_gmcp_room()
end
end –if gmcphandler
end
last_id = -1
room_id = -1
function got_gmcp_room()
room_id = tonumber(gmcpval(“num”))
if (last_id ~= room_id) then
sendAutolootIfNeeded()
end
last_id = room_id
end
autoLoot = -1
autoReset = true
calledFromPlugin = false
function sendAutolootIfNeeded()
— If we are in vlad and autoloot is not OFF (either ON or Unknown)
calledFromPlugin = false
if (room_id >= 15970 and room_id <= 16070) then
if (autoLoot ~= 2) then
Note(“Entering Vlad. Turning off Autoloot.”)
calledFromPlugin = true
autoReset = true
Send(“autoloot”)
end
else
— If they turn off autoloot and go to vlad, don’t turn it back once we leave.
if (autoLoot ~= 1 and autoReset == true) then
Note(“Leaving Vlad. Turning on Autoloot.”)
calledFromPlugin = true
autoReset = false
Send(“autoloot”)
end
end
end
function setAutoloot(newval)
if (newval == true) then
autoLoot = 1
elseif (newval == false) then
autoLoot = 2
else
Note(“NewVal neither true nor false ?!”)
return
end
if (calledFromPlugin == true) then
sendAutolootIfNeeded()
end
end
]]>
</script>
<!– Plugin help –>
<aliases>
<alias
script=”OnHelp”
match=”Galabans_vlad_autoloot:help”
enabled=”y”
>
</alias>
</aliases>
<script>
<![CDATA[
function OnHelp ()
world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
end
]]>
</script>
</muclient>
Closing quotes not right if copied from forum.