Except, in the development forum, I usually yell and throw things. Otherwise, pretty similar.If nothing else this topic would give people an idea of what normally happens in the development section of forum, ideas get thrown around with different solutions and possible issues until in the end we get something that works to do what we want it to do
create log file userfunction (logInfo)
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Only post additional bot resources here. Please do not ask unrelated questions.
- Administrator
- Site Admin
- Posts: 5307
- Joined: Sat Jan 05, 2008 4:21 pm
Re: create log file userfunction
Re: create log file userfunction
lolAdministrator wrote:Except, in the development forum, I usually yell and throw things. Otherwise, pretty similar.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: create log file userfunction (logInfo)
thanks for this helpful waypoints
Re: create log file userfunction (logInfo)
I added this to a userfunction to get a log of errors.
basically it now does the usual code when an error occurs, which is the errorCallback() but it will also do the logInfo aswell which looks something like this. Saved in a file that is named same as the characters name in the logs/crashes folder.
This is just the error when exiting commandline.
I have added it to the logger userfunction with an option at the top to turn on error logging, give it a try.
Code: Select all
function logtrace()
errorCallback()
logInfo(player.Name,debug.traceback(),true,"crashes")
end
atError(logtrace)
Code: Select all
03/13/13 10:40:44 stack traceback:
...s/romglobal/userfunctions/userfunction_lisafunctions.lua:558: in function '__ERROR_CALLBACK'
C:\micromacro\lib\lib.lua:650: in function <C:\micromacro\lib\lib.lua:562>
[C]: in function 'pcall'
C:\micromacro\lib\lib.lua:736: in function 'startMacro'
scripts\rom/bot.lua:1131: in main chunk
I have added it to the logger userfunction with an option at the top to turn on error logging, give it a try.
Code: Select all
local logerrors = false -- change to true if you want to log the errors the bot has
- Attachments
-
- userfunction_logger.lua
- V 2.4
- (1.5 KiB) Downloaded 226 times
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: create log file userfunction (logInfo)
I get a bit sick of trying to remember where stuff is on all my accounts.
So I made up this userfunction and figured I would share it.
Basically it will overwrite the file for that character each time the function is called, can either just pop it in the profile onload or do up a WP like this and it will just cycle through an account saving the item info.
This is an example.
So I made up this userfunction and figured I would share it.
Code: Select all
function logloot()
local function comma_value(n)
local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$')
return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right
end
local acn = RoMScript("GetAccountName()")
local gold = RoMScript('GetPlayerMoney("copper");')
logInfo(player.Name, "", true, "loot/"..acn, "new")
logInfo(player.Name, "Gold: "..comma_value(gold), false, "loot/"..acn)
logInfo(player.Name, "--=== Bank ===--", false, "loot/"..acn)
logInfo(player.Name, "Slot:\tCount:\tName:", false, "loot/"..acn)
bank:update()
for i = 1, 300 do
if bank.BagSlot[i].Id ~= 0 then
logInfo(player.Name, i.."\t\t"..bank.BagSlot[i].ItemCount.."\t\t"..bank.BagSlot[i].Name, false, "loot/"..acn)
end
end
logInfo(player.Name, "\n--=== Item Shop ===--", false, "loot/"..acn)
logInfo(player.Name, "Slot:\tCount:\tName:", false, "loot/"..acn)
inventory:update()
for slot = 1, 60 do
item = inventory.BagSlot[slot]
if item.Available and item.Name ~= "<EMPTY>" then
logInfo(player.Name, slot.."\t\t"..item.ItemCount.."\t\t"..item.Name, false, "loot/"..acn)
end
end
logInfo(player.Name, "\n--=== Inventory ===--", false, "loot/"..acn)
logInfo(player.Name, "Slot:\tCount:\tName:", false, "loot/"..acn)
for slot = 61, 240 do
item = inventory.BagSlot[slot]
if item.Available and item.Name ~= "<EMPTY>" then
logInfo(player.Name, slot.."\t\t"..item.ItemCount.."\t\t"..item.Name, false, "loot/"..acn)
end
end
end
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints>
<onLoad>
logloot()
ChangeChar()
waitForLoadingScreen()
yrest(3000)
loadProfile()
loadPaths(__WPL.FileName)
</onLoad>
</waypoints>
Code: Select all
03/23/13 01:23:25
--=== Bank ===--
Slot: Count: Name:
1 1 Suppression Heavy Boots of the Fort
2 2 Temporary Mount Use Voucher
3 2 Witchcraft Scroll Collection Box
4 21 Royal Furniture Recipe Collection Box
5 99 Simple Repair Hammer
6 99 Simple Repair Hammer
7 34 Simple Repair Hammer
8 99 Craftsman's Recipe Coupon
9 2 Craftsman's Recipe Coupon
10 60 Material Package for Magical Instruments
11 91 Horse Rental Ticket
12 5 Phirius Elixir - Type D
13 20 Phirius Elixir - Type C
14 60 Phirius Elixir - Type B
15 99 Phirius Elixir - Type A
16 61 Phirius Elixir - Type A
17 11 Phirius Potion - Type D
18 29 Phirius Potion - Type C
19 83 Phirius Potion - Type B
20 1 Phirius Special Water - Type C
21 2 Phirius Special Water - Type A
22 125 Ancient Memento
23 1 Fruit of Extra Experience
24 20 Vanquisher's Loot
25 156 Ghost Card
--=== Item Shop ===--
Slot: Count: Name:
9 1 Little Jumping Flower - Pet Egg (30 Days)
13 13 Golden Repair Hammer
14 1 High Quality Experience Potion
19 17 Transport Rune
20 11 Home-sweet-home
21 8 Marking Ink
23 2 Curse Scroll (Wicked Freeze)
24 4 Curse Scroll (Instant Transport)
25 4 Curse Scroll (Time Extension)
26 2 Curse Scroll (Cannon Permutation)
29 1 Purified Fusion Stone
44 2 Advanced Weapon Driller
45 1 Phoenix's Redemption
47 5 Midsummer Heat
48 5 Nebula Diffusion
49 10 Golden Brilliance
50 1 Advanced Skill Reset Stone
--=== Inventory ===--
Slot: Count: Name:
61 1 Recipe - Tador's Brilliant Armor
62 1 Vengeance Leather Boots of the Fort
63 1 Vengeance Leather Boots of the Fort
64 1 Vengeance Leather Boots of the Fort
65 1 Vengeance Leather Boots of the Fort
66 1 Pulverizing Light Boots of the Fort
67 1 Fusion Stone
68 1 Fusion Stone
69 1 Fusion Stone
70 1 Fusion Stone
71 1 Fusion Stone
72 1 Fusion Stone
73 24 Simple Repair Hammer
74 10 Craftsman's Recipe Coupon
75 13 Material Package for Magical Instruments
76 11 Horse Rental Ticket
77 15 Mana Potion
78 15 Healing Potion
79 30 Healing Potion
80 30 Healing Potion
81 23 Phirius Potion - Type C
82 45 Phirius Potion - Type B
83 98 Phirius Potion - Type A
84 560 Phirius Shell
85 2 Vanquisher's Loot
86 14 Ghost Card
87 215 Phirius Token Coin
88 60 Wind Element
89 4 Craft Festival Celebration Certificate
90 1 Recipe - Royal Decorative Armor
91 10 Defense III
92 1 Fusion Stone
93 1 Fusion Stone
94 1 Fusion Stone
95 1 Fusion Stone
96 1 Fusion Stone
97 1 Fusion Stone
98 1 Fusion Stone
99 3 Royal Furniture Recipe Collection Box
100 10 Golden Brilliance
101 2 Magic Hormone
102 2 Certificate: The Key to Survival
103 4 Certificate: The Key to Timing
104 6 Frog Celebration Certificate
105 5 Autumn Banquet Voucher
106 1 Colorful Firework Package
107 1 4th Anniversary Gasha
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: create log file userfunction (logInfo)
This is great!lisa wrote:I get a bit sick of trying to remember where stuff is on all my accounts.
So I made up this userfunction and figured I would share it.
Usually i use Inventory viewer but as soon as the game crashed (which it always does when i close it or bot or anything else) it looses the data from the session.
I do updates of the profile for rom but still miserably bad to lose data!
This will help a lot :;)
Re: create log file userfunction (logInfo)
Added in gold aswell, looks like this
I just use notepad++ and do find in files for the loot folder and I see where all the items I am searching for are. A search for "Gold:" also gives me a complete list of all the gold I have.
I also changed Rock's loginnextchar userfunction so it uses the logloot() before logging the character.
Code: Select all
03/23/13 10:30:30
Gold: 119,442
--=== Bank ===--
Slot: Count: Name:
I also changed Rock's loginnextchar userfunction so it uses the logloot() before logging the character.
Code: Select all
function ChangeChar(char, acc, chan)
if logloot then logloot() end
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
- attackspeedzero
- Posts: 28
- Joined: Sat Mar 02, 2013 6:24 pm
Re: create log file userfunction (logInfo)
Thanks for this awesome script!
I ran into a lua error issue with the bank section of function logloot() ...
Fixed by changing to
I ran into a lua error issue with the bank section of function logloot() ...
Fixed by changing
Code: Select all
bank:update()
for i = 1, 300 do
Code: Select all
bank:update()
for i = 1, bank.MaxSlots do
Last edited by attackspeedzero on Thu Mar 28, 2013 11:37 am, edited 1 time in total.
Re: create log file userfunction (logInfo)
Strange, I thought bank.MaxSlots also equals 300. Unless you changed it of course.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
- attackspeedzero
- Posts: 28
- Joined: Sat Mar 02, 2013 6:24 pm
Re: create log file userfunction (logInfo)
Was 200 in my bank.lua file, not sure if I have a different version than what's current.
Re: create log file userfunction (logInfo)
Hmm I forgot older clients would need to be 200, setting it to the bank.MaxSlots is a good idea.attackspeedzero wrote:Was 200 in my bank.lua file, not sure if I have a different version than what's current.
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: create log file userfunction (logInfo)
create log file userfunction (logInfo) what is it? What does it do?
Re: create log file userfunction (logInfo)
It is simple for making a logfile for the bot as a txt.
When you have it many mini-game scripts will write a report when finished.
When you have it many mini-game scripts will write a report when finished.
Jack-of-all-trades, but master-of-only of a few
My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226
My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226
Who is online
Users browsing this forum: No registered users and 3 guests