parent
68da8974ef
commit
debdabed61
@ -0,0 +1,286 @@
|
||||
<?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="1.0"
|
||||
>
|
||||
<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.
|
||||
|
||||
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"
|
||||
omit_from_output="y"
|
||||
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 == "%1" then
|
||||
		Hyperlink("lbid %1", "%1", "", "white", "", 0)
|
||||
	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="^(?:(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 == "%2" then
|
||||
		Hyperlink(bida .. " %2", "%2", "", "yellow", "", 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("bid %1", "%1", "", "red", "", 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="100"
|
||||
>
|
||||
<send>local bop = string.gsub("%1", ",", "")
|
||||
local hlink = "lbid " .. marketbidn .. " " .. bop
|
||||
|
||||
for i,v in pairs(TriggerStyleRuns) do
|
||||
	if v.text:gsub(" ", "") == "%1" then
|
||||
		Hyperlink(hlink, "%1", "", "yellow", "", 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>
|
||||
</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>
|
||||
</aliases>
|
||||
|
||||
<!-- Script -->
|
||||
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function OnPluginInstall()
|
||||
PLUGIN_VERSION = GetPluginInfo(GetPluginID(), 19)
|
||||
PLUGIN_NAME = GetPluginInfo(GetPluginID(), 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)")
|
||||
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>
|
Loading…
Reference in new issue