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.
393 lines
9.8 KiB
393 lines
9.8 KiB
<?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.48"
|
|
>
|
|
<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.
|
|
|
|
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+.*?$"
|
|
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+string.len(ls)) < sl then
|
|
ts = string.rep(" ", sl-(spl+ls))
|
|
end
|
|
ColourTell(RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), ls)
|
|
Hyperlink("!!381ff501f4f32c86cc30ad4c:lbid_capture(%1)", "%1", "lbid %1", RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), 0)
|
|
|
|
--Hyperlink("lbid %1", "%1", "", RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), 0)
|
|
|
|
ColourTell(RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), ts)
|
|
else
|
|
ColourTell (RGBColourToName (v.textcolour),
|
|
RGBColourToName (v.backcolour),
|
|
v.text)
|
|
end
|
|
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+\.)?"
|
|
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("!!381ff501f4f32c86cc30ad4c:" .. bida .. "_capture(%1)", "%1", bida .. "%1", RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), 0)
|
|
|
|
--Hyperlink(bida .. " %2", v.text, "", RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), 0)
|
|
|
|
else
|
|
ColourTell (RGBColourToName (v.textcolour),
|
|
RGBColourToName (v.backcolour),
|
|
v.text)
|
|
end
|
|
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("!!381ff501f4f32c86cc30ad4c:bid_capture(%1)", "%1", "bid %1", RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), 0)
|
|
|
|
--Hyperlink("bid %1", "%1", "", RGBColourToName(v.textcolour), RGBColourToName(v.backcolour), 0)
|
|
else
|
|
ColourTell (RGBColourToName (v.textcolour),
|
|
RGBColourToName (v.backcolour),
|
|
v.text)
|
|
end
|
|
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
|
|
|
|
totalsecs = daysec+hoursec+minsec+seconds
|
|
|
|
return os.date('(%H:%M %b %d)', os.time()+totalsecs)
|
|
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="5"
|
|
>
|
|
<send>
|
|
local bop = string.gsub("%1", ",", "")
|
|
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)
|
|
ColourTell("", "", string.rep(" ", v.text:len() - string.len("%1")))
|
|
else
|
|
ColourTell (RGBColourToName (v.textcolour),
|
|
RGBColourToName (v.backcolour),
|
|
v.text)
|
|
end
|
|
end
|
|
Note ("")</send>
|
|
</trigger>
|
|
<trigger
|
|
enabled="y"
|
|
match="^\{lbid\}$"
|
|
script="lbid_redirect"
|
|
omit_from_output="y"
|
|
name="lbid_start"
|
|
sequence="100"
|
|
></trigger>
|
|
<trigger
|
|
enabled="n"
|
|
match="*"
|
|
script="lbid_redirect"
|
|
name="multi_line_lbid"
|
|
omit_from_output="y"
|
|
sequence="110"
|
|
></trigger>
|
|
<trigger
|
|
enabled="n"
|
|
match="^\{/lbid\}"
|
|
script="lbid_redirect"
|
|
omit_from_output="y"
|
|
name="lbid_end"
|
|
sequence="100"
|
|
></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>
|
|
</aliases>
|
|
|
|
<!-- Script -->
|
|
|
|
|
|
<script>
|
|
<![CDATA[
|
|
|
|
-- Window Creation
|
|
require "movewindow"
|
|
require "mw"
|
|
require "gmcphelper"
|
|
|
|
background_colour = GetNormalColour(1) or 0
|
|
title_colour = 0x292929
|
|
border_colour = 0xdddddd
|
|
title_gradient_col1 = GetNormalColour(1) or 0
|
|
title_gradient_col1 = 0x444444
|
|
default_width = 500
|
|
default_height = 250
|
|
default_x = 658
|
|
default_y = 100
|
|
lbid_lines = {}
|
|
|
|
RESIZE_TAG_SIZE = 10
|
|
MIN_SIZE = 100
|
|
TITLE_HEIGHT = 11
|
|
|
|
startx = ""
|
|
starty = ""
|
|
posx = ""
|
|
posy = ""
|
|
hotspot_id = ""
|
|
page_built = false
|
|
|
|
function lbid_capture(wildcards)
|
|
if state ~= 3 then
|
|
Send("echo {lbid}")
|
|
Send("lbid " .. wildcards)
|
|
Send("echo {/lbid}")
|
|
end
|
|
end
|
|
|
|
function rbid_capture(wildcards)
|
|
if state ~= 3 then
|
|
Send("echo {lbid}")
|
|
Send("rbid " .. wildcards)
|
|
Send("echo {/lbid}")
|
|
end
|
|
end
|
|
|
|
function bid_capture(wildcards)
|
|
if state ~= 3 then
|
|
Send("echo {lbid}")
|
|
Send("bid " .. wildcards)
|
|
Send("echo {/lbid}")
|
|
end
|
|
end
|
|
|
|
function OnPluginInstall()
|
|
PLUGIN_VERSION = GetPluginInfo(GetPluginID(), 19)
|
|
PLUGIN_NAME = GetPluginInfo(GetPluginID(), 1)
|
|
BUYOUT_OPTION = 1
|
|
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)")
|
|
ColourNote("Update complete!")
|
|
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>
|