Page 1 of 1

Print name when client crashes

Posted: Tue Jul 15, 2014 11:58 pm
by ZZZZZ
If the client crashes and the bot doesn't detect it, rather than the bot simply replying with the error message when you close the client

Code: Select all

2014-07-16 14:46:50 - E:\micromacro\scripts\rom/login.lua:75: E:/micromacro/scri
pts/rom/classes/pawn.lua:156: bad argument #1 to 'readfunc' ((null))
where could I add a print of the character name that crashed? That way it isn't a guessing game when logging mini-game alts back in.

Thanks

Re: Print name when client crashes

Posted: Wed Jul 16, 2014 2:18 am
by lisa
Does it also print .
Attached game client has crashed. Killing client
or
The game client did not crash.
I am guessing it does, reason I ask is because in functions.lua line 352-364 you will find a hint at what you could do =)
Hmm unless I haven't updated rombot in a while and the lines won't mean anything, search for

Code: Select all

function errorCallback(script, line, message)
=)

Spoiler alert (incase you didn't quite understand my hint),
this is in my logger function.

Code: Select all

function logtrace()
	errorCallback()
	logInfo(player.Name,debug.traceback(),true,"crashes")
end

if logerrors then
	atError(logtrace)
end
TBH just get my logger function and change top to true.

Code: Select all

local logerrors = false -- change to true if you want to log the errors the bot has

Re: Print name when client crashes

Posted: Wed Jul 16, 2014 5:40 am
by ZZZZZ
Not a fan of opening log files to look up something like that, seems a waste of time to me lol, I just went with your first 'hint' and added player.Name to the game crash error.

Code: Select all

The game client did not crash. (Character: Example)