need help with FILE.EM

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
User avatar
atreiu
Grandmaster Poster
Posts: 151
Joined: Mon May 24, 2010 1:08 pm

need help with FILE.EM

Post by atreiu »

hello world!

problem_1: by using ReadFile() func the server goes crushdown.

"[06/30 19:33:12] Unhandled Exception! Writing Minidump file.
This file with explanation and last lines from log files should be given to the development team.
Saved dump file to 'POL097-2008-02-26 Coregina-20100630193220-0.dmp'
Last Script: scripts/textcmd/player/testcom26.ecl PC: 7"

testcom26.src:

var array1 := ReadFile( "owners.txt" );

*owners.txt is placed in same folder with command.

fileacces.cfg:

FileAccess
{
AllowRead 1
AllowRemote 1
AllowWrite 1
AllowAppend 1
Package moneystone
Extension .txt
}

problem_2: WriteFile() func dont work.

WriteFile( "owners.txt", "this is a text!" );
WriteFile( ":occlo_game:owners.txt", "this is a text!" );

Maybe i did something wrong?!
Terciob
Master Poster
Posts: 90
Joined: Fri Nov 07, 2008 3:47 am

Re: need help with FILE.EM

Post by Terciob »

Old cores has a problem with readfile cross pkg and script folder.
You can migrate to 098.2 or 099Beta to solve this or use readfile inside pol/pkg/*pkg folder*/
WriteFile( "owners.txt", "this is a text!" );
WriteFile( ":occlo_game:owners.txt", "this is a text!" );
http://docs.polserver.com/pol099/fullfu ... #WriteFile
Writefile use array of strings, like this:
WriteFile( "owners.txt", array {"this is a text!", "this is another text!"} );

TIP: Use broadcast (WriteFile( "owners.txt", "this is a text!" )); This will show the errortext in your Uo screen this case: "Invalid parameter type".
Post Reply