You can remotely get information about your character and/or your bot status (like profit/waste).
Simply PM your character with any command (which you can modify to any word) and the bot will PM you back with the information you want.
Currently it does have 3 commands: !Info, !supply, !profit.
The !info command will PM your character's level, balance, stamina, played time, exp/h and time to next level.
The !supply command will PM how much of each supply item has been used.
The !profit command will PM the current profit/waste of your hunt.
Configuration
Set up the safe list with the names of your characters and the words to the commands.
Code
init start
-- --
-- Remote Info for WindBot --
-- Author: Rukasu --
-- Created on 26/05/2014 --
-- Script Version: 1.1.0 --
-- --
-- if you have any suggestions --
-- or if you found any bug --
-- contact me at WindBot forums --
-- --
local safelist = { "Character Name 1", "Character Name 2", "Character Name 3..." } -- Insert as many names as you want.
local commands = { "!info", "!supply", "!profit"} -- change to any word you want or just leave as it is.
------------------------------------------------------------------
-- DON'T TOUCH ANYTHING BELOW UNLESS YOU KNOW WHAT YOU'RE DOING --
------------------------------------------------------------------
local old_type = getsetting('Settings/TypeWaitTime')
local old_press = getsetting('Settings/PressWaitTime')
init end
auto(100)
foreach newmessage m do
if m.type == MSG_PVT then
-- set type/press wait time --
setsetting('Settings/TypeWaitTime', '10 to 20 ms')
setsetting('Settings/PressWaitTime', '10 to 20 ms')
-- general info --
for i = 1, #safelist do
if m.content:lower() == commands[1]:lower() and (m.sender == safelist[i] and maround(7) == 0) then
for c = 1, #info do
say("Local Chat", string.format("*%s* %s", m.sender, info[c]()))
end
end
end
-- supplies used --
-- kinda useless command tho --
for i = 1, #safelist do
if m.content:lower() == commands[2]:lower() and (m.sender == safelist[i] and maround(7) == 0) then
foreach supplyitem n do
say("Local Chat", string.format("*%s* %s: %s. %s: %s gps", m.sender, n.name .. " used", n.amountused, "Total spent", num(n.buyprice * n.amountused)))
end
end
end
-- profit --
for i = 1, #safelist do
if m.content:lower() == commands[3]:lower() and (m.sender == safelist[i] and maround(7) == 0) then
drop_profit = 0
supply_waste = 0
foreach lootingitem drops do
drop_profit = drops.sellprice * drops.amountlooted + drop_profit
end
foreach supplyitem supply do
supply_waste = supply.buyprice * supply.amountused + supply_waste
end
say("Local Chat", string.format("*%s* %s: %s gps", m.sender, "Total profit", num(drop_profit - supply_waste)))
end
end
-- go back to the original type/press wait time --
setsetting('Settings/PressWaitTime', old_press)
setsetting('Settings/TypeWaitTime', old_type)
end
end
Changelog
Code:
- 1.0.0 Release
- 1.1.0 Made some changes to make it safer (thanks to Leonardo and Orexx)
- Added a gist link to the thread
It works, however, I suggest to make it type when no monsters are on screen, as if its hunting a hardcore script with a lot of actions, it could potentially, kill the character while trying to PM.
Nice work.
05-27-2014, 07:12 AM
Rukasu
Yeah, I thought about it. But I think it won't kill the character since it won't overwrite the bot actions. If the bot needs to heal, it'll heal and will forget abou the PM. (it actually happenned lots of times while I was testing the functions)
But I'll add another check just for security purposes, thank you for your feedback :D
05-27-2014, 12:41 PM
Leonardo
A nice piece of code, I'll just add a few tips.
Probably you noticed when you say "!info" the information is frozen. It's because you store the info on a variable and then just read it.
You can fix by putting them on functions. That will make it refresh each time it's called.
local info = {
function() return "Level: ".. $level end,
function() return "Balance: " .. num($balance) end,
function() return "Stamina: ".. time($stamina) end,
function() return "Played time: ".. time(math.floor($charactertime / 1000)) end,
function() return "Exp/h: ".. num($exphour) end,
function() return "Time to next level: " .. time(timetolevel()) end
}
@Topic
Updated the script to Version 1.1.0
Now it will only PM if there's no monsters on the screen.
10-02-2014, 05:05 AM
yuricasbr
Nice, can add a comand to got label "leave" or "depositer" or any i want ?
is good for ppl send chars when near save server..
PD: Sorry my sht english
10-08-2014, 04:33 PM
dobotao
I tried it out and did not work.
12-16-2014, 08:28 PM
Rukasu
Quote:
Originally Posted by yuricasbr
Nice, can add a comand to got label "leave" or "depositer" or any i want ?
is good for ppl send chars when near save server..
PD: Sorry my sht english
Yeah, I was trying to figure out how to do that actually. When I do, I'll add that function.
Quote:
Originally Posted by dobotao
I tried it out and did not work.
Did you put the names of your characters on the safelist?
Because it seems to work here.
05-10-2015, 08:57 PM
EdwinYaire
works great it is usefull because i ever check my chars over remote desktop now you make it easy xd, should be fine add if there is another player on the screen