You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

308 lines
7.8 KiB

9 years ago
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, March 29, 2016, 2:45 PM -->
<!-- MuClient version 5.01 -->
<!-- Plugin "Auction_Utilities" generated by Plugin Wizard -->
<muclient>
<plugin
name="Auction_Utilities"
author="Arcidayne"
id="381ff501f4f32c86cc30ad4c"
language="Lua"
purpose="Auction Helper"
save_state="y"
date_written="2016-03-29 14:40:46"
requires="4.80"
version="2.0"
9 years ago
>
<description trim="y">
<![CDATA[
Pretty automatic. There is one alias that you can utilize to safely bid on items:
safe <commands>
This prevents you from bidding 35,000,000 when you mean to bid 3,500,000. This is accomplished by entering the following:
safe bid 123 3.5m
which will then send 'bid 123 3500000'
aucutils update -- This will update the plugin if there are new versions available.
aucutils buyout <on|off> -- Turns on/off clickable buyouts.
9 years ago
Any questions, send a tell or personal note to Arcidayne!
]]>
</description>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
group="Auction_Market"
keep_evaluating="y"
match="^\| Current bid.*\|$"
name="CurrentBid"
regexp="y"
send_to="14"
sequence="100"
>
<send>EnableTrigger("BuyoutLink", false)
EnableTrigger("CurrentBid", false)</send>
</trigger>
<trigger
enabled="y"
group="Auction_Market"
keep_evaluating="y"
match="^\s+?\*?(\d+)\s+.*?\s+\d+\s+.*?\s+[\d,]\*?+\s+\d+\s+.*?$"
9 years ago
omit_from_output="y"
regexp="y"
send_to="14"
sequence="100"
>
<send>for i,v in pairs(TriggerStyleRuns) do
if v.text:gsub(" ", "") == "%1" then
local st, sl, spl = string.find(v.text, "[^%s]"), string.len(v.text), string.len("%1")
local ls, ts = string.rep(" ", st-1), ""
if (spl+ls) < sl then
ts = string.rep(" ", sl-(spl+ls))
end
ColourTell(RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), ls)
Hyperlink("lbid %1", "%1", "", RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), 0)
ColourTell(RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), ts)
else
ColourTell (RGBColourToName (v.textcolour),
9 years ago
RGBColourToName (v.backcolour),
v.text)
end
9 years ago
end
Note ("")</send>
</trigger>
<trigger
enabled="y"
group="Auction_Market"
lines_to_match="4"
match="^\| Market Item Number\s+: (\d+)\s+\|"
regexp="y"
send_to="12"
sequence="100"
>
<send>marketbidn, bop = nil, nil
marketbidn = "%1"
EnableTrigger("BuyoutLink", true)
EnableTrigger("CurrentBid", true)</send>
</trigger>
<trigger
enabled="y"
group="Auction_Market"
keep_evaluating="y"
match="^(?:\{chan ch=.*\})?(?:(Market|Auction|Remort Auction)): \w+ (?:is auctioning|is selling|of).*(?:(?:Level \d+, )?Num (\d+)\))\.?(?: Auction is for .*\.| Current bid is \d+\.)?"
9 years ago
omit_from_output="y"
regexp="y"
send_to="14"
sequence="100"
>
<send>local bida = "bid"
if "%1" == "Market" then bida = "lbid" elseif "%1" == "Remort Auction" then bida = "rbid" end
for i,v in pairs(TriggerStyleRuns) do
if v.text:gsub(" ", "") == "%2" then
Hyperlink(bida .. " %2", v.text, "", RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), 0)
else
ColourTell (RGBColourToName (v.textcolour),
9 years ago
RGBColourToName (v.backcolour),
v.text)
end
9 years ago
end
Note ("")</send>
</trigger>
<trigger
enabled="y"
group="Auction_Market"
match="^\s{0,3}(\d+)\s+-\s+\w+.*?\d+\s+[\d,]+\s+\d+$"
omit_from_output="y"
regexp="y"
send_to="14"
sequence="100"
>
<send>for i,v in pairs(TriggerStyleRuns) do
if v.text == "%1" then
Hyperlink("bid %1", "%1", "", RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), 0)
else
ColourTell (RGBColourToName (v.textcolour),
9 years ago
RGBColourToName (v.backcolour),
v.text)
end
9 years ago
end
Note ("")</send>
</trigger>
<trigger
enabled="y"
group="Auction_Market"
match="^(\| Auction will end in\s+: (?:(\d+) days? and )?(?:(\d+):)?(\d+):(\d+))(\s+)\|$"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>function get_date(days, hours, minutes, seconds)
daysec = days*86400
hoursec = hours*3600
minsec = minutes*60
9 years ago
totalsecs = daysec+hoursec+minsec+seconds
9 years ago
return os.date('(%H:%M %b %d)', os.time()+totalsecs)
9 years ago
end
local aucd, auch, aucm, aucs = 0, 0, tonumber("%4"), tonumber("%5")
if "%2" ~= "" then aucd = tonumber("%2") end
if "%3" ~= "" then auch = tonumber("%3") end
local date_end = get_date(aucd, auch, aucm, aucs)
ColourNote("white", "", "%1 ", "cyan", "", date_end, "white", "", string.rep(" ", string.len("%6")-string.len(date_end)-1) .. "|")
</send>
</trigger>
<trigger
group="Auction_Market"
match="^\| Buyout Price\s+:\s+([\d,]+)\s+\|$"
name="BuyoutLink"
omit_from_output="y"
regexp="y"
send_to="14"
sequence="100"
>
<send>
local bop = string.gsub("%1", ",", "")
9 years ago
local hlink = "lbid " .. marketbidn .. " " .. bop
for i,v in pairs(TriggerStyleRuns) do
if v.text:gsub(" ", "") == "%1" and BUYOUT_OPTION == 1 then
Hyperlink(hlink, "%1", "", RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), 0)
9 years ago
ColourTell("", "", string.rep(" ", v.text:len() - string.len("%1")))
else
ColourTell (RGBColourToName (v.textcolour),
9 years ago
RGBColourToName (v.backcolour),
v.text)
end
9 years ago
end
Note ("")</send>
9 years ago
</trigger>
</triggers>
<!-- Aliases -->
<aliases>
<alias
match="^safe (.*) ([\d\.]+)(k|K|m|M|b|B)(.*)?"
enabled="y"
group="Auction_Market"
regexp="y"
send_to="12"
sequence="100"
>
<send>local amount = tonumber("%2")
if "%3" == "k" or "%3" == "K" then amount = amount * 1000 end
if "%3" == "m" or "%3" == "M" then amount = amount * 1000000 end
if "%3" == "b" or "%3" == "B" then amount = amount * 1000000000 end
Send("%1 " .. amount .. "%4")</send>
</alias>
<alias
match="^aucutils update$"
enabled="y"
group="Auction_Market"
regexp="y"
script="update_plugin"
sequence="100"
>
</alias>
<alias
match="^aucutils buyout (on|off)$"
enabled="y"
group="Auction_Market"
regexp="y"
send_to="12"
sequence="100"
>
<send>if "%1" == "on" then BUYOUT_OPTION = 1 else BUYOUT_OPTION = 0 end
ColourNote("white", "blue", "Turning %1 clickable buyouts!")</send>
</alias>
9 years ago
</aliases>
<!-- Script -->
<script>
<![CDATA[
function OnPluginInstall()
PLUGIN_VERSION = GetPluginInfo(GetPluginID(), 19)
PLUGIN_NAME = GetPluginInfo(GetPluginID(), 1)
BUYOUT_OPTION = 1
9 years ago
end
function update_plugin()
raw = "https://raw.githubusercontent.com/Arcidayne/Aardwolf-Scripts/master/Auction_Utilities/Auction_Utilities.xml"
async_ok, async = pcall (require, "async")
if async_ok then
plugin_page = async.doAsyncRemoteRequest(raw, raw_get, "HTTPS")
else
ColourNote("white", "blue", "Error on plugin update!")
end
end
function raw_get(retval, page, status, headers, full_status, request_url)
if status == 200 then
raw_version = tonumber(string.match(page, '%s%s+version="([0-9%.]+)"'))
end
if raw_version == PLUGIN_VERSION then
ColourNote("white", "blue", PLUGIN_NAME .. " is up-to-date.")
elseif raw_version > PLUGIN_VERSION then
ColourNote("white", "blue", "Updating from version " .. PLUGIN_VERSION .. " to " .. raw_version .. ". Do not touch anything!")
local file = io.open(GetPluginInfo(GetPluginID(), 6), "w")
file:write(page)
file:close()
end
raw_version = nil
if "" == GetAlphaOption("script_prefix") then
SetAlphaOption("script_prefix", "\\\\\\")
end
Execute(GetAlphaOption("script_prefix") .. "DoAfterSpecial(1, \"ReloadPlugin('" .. GetPluginID() .. "')\", sendto.script)")
end -- end Update code
]]>
</script>
<!-- Plugin help -->
<aliases>
<alias
script="OnHelp"
match="aucutils help"
enabled="y"
>
</alias>
</aliases>
<script>
<![CDATA[
function OnHelp ()
world.Note (world.GetPluginInfo (world.GetPluginID (), 3))
end
]]>
</script>
</muclient>