Closing openkore instead of showing errors

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderator: Moderators

Message
Author
urinha
Noob
Noob
Posts: 2
Joined: 01 May 2009, 11:05
Noob?: No

Closing openkore instead of showing errors

#1 Post by urinha »

Hey there
I was wondering if there's a way to close openkore instead of showing up errors like "press enter..." and "timeout.."
doing so I can setup a routine to keep reopening the application instead of pressing "enter" or so
:)

thanks in advance

sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: Closing openkore instead of showing errors

#2 Post by sli »

I can only help with this on Linux/Unix and most derivatives. Something like...

Code: Select all

pe -e | grep ([0-9]+) perl.*? | kill -9
...or even better...

Code: Select all

alias killps="awk '// { print \$2 }'  | xargs kill"
ps -ef | grep perl | grep -v grep | killps
You can get grep, cat, awk, and kill for Windows, though.
cs : ee : realist

iamanoob
Plain Yogurt
Plain Yogurt
Posts: 82
Joined: 04 Apr 2008, 09:49

Re: Closing openkore instead of showing errors

#3 Post by iamanoob »

ErrorHandler.pm

Code: Select all

	if (open(F, ">:utf8", "errors.txt")) {
		print F $log;
		close F;
	}
	showError($display);
	exit 9;
}
remove line 132 or make it a comment

how to restart it?
i dont know
MAYBE... like this

filename of the shortcut you're using for the bot
is the same name with your username
i.e. iamanoob.lnk (shortcut's name)
username iamanoob (value in config.txt)
replace line 132 with

Code: Select all

Utils::Win32::ShellExecute(1,'open',$config{username}.'.lnk');
works AS LONG as your shortcut (.lnk) name is the SAME with your username

hope this helps
also.. post on how you would restart your start.exe
either with a batch file or a script or i don't know XD
Image
DARKest Ninja

sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: Closing openkore instead of showing errors

#4 Post by sli »

Was this thread changed since I posted?

Anyway, yes, iamanoob has the code to remove halting on errors. Just do this:

Code: Select all

:start
openkore
goto start
...or...

Code: Select all

#!/bin/sh
while [ 1 ]
do
    ./openkore.pl
done
cs : ee : realist

Locked