The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SERV.WRITEFILE???
Author Message
Llirik
Journeyman
*

Posts: 116
Likes Given: 0
Likes Received: 10 in 8 posts
Joined: Feb 2015
Reputation: 0

UO Forum

Post: #1
SERV.WRITEFILE???
How can I use this command:

SERV.WRITEFILE c:\sphere\accounts\sphereacct.scp Account

?

18:03:ERROR:(test.scp,6)Undefined keyword 'WRITEFILE'
(This post was last modified: 09-29-2015 01:09 AM by Llirik.)
09-29-2015 01:05 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Artyk
Journeyman
*

Posts: 75
Likes Given: 43
Likes Received: 9 in 9 posts
Joined: Sep 2014
Reputation: 0



Post: #2
RE: SERV.WRITEFILE???
You have to enable file handling in sphere.ini in this section :
Code:
// Option flags
// Flags for options that affect server behaviour but not compatibility
// See the revisions.txt file for more details on this
// OF_NoDClickTarget        00000001 // Weapons won't open a target in the cursor after DClicking them for equip.
// OF_NoSmoothSailing        00000002 // Deactivate Smooth Sailing for clients >= 7.0.8.13
// OF_ScaleDamageByDurability    00000004 // Weapons/armors will lose DAM/AR effect based on it's current durability
// OF_Command_Sysmsgs        00000008 // Shows status of hearall, allshow, allmove... commands after toggling them
// OF_PetSlots            00000010 // Enable AOS pet follower slots on chars. If enabled, all players must have MAXFOLLOWER property set (default=5)
// OF_OSIMultiSight        00000020 // Enabling this prevents all the items inside a multi of being sent until a player enters the multi.
// OF_Items_AutoName        00000040
// OF_FileCommands        00000080
// OF_NoItemNaming        00000100 // Disable the DEFMSG."grandmaster_mark" in crafted items
// OF_NoHouseMuteSpeech        00000200 // By default players outside multis can't hear what is told inside, this flag disable this.
// OF_NoContextMenuLOS        00000400 // By default you need to be in LOS to pet/vendor to use the context menu, this flag disables this
// OF_Flood_Protection        00001000
// OF_Buffs            00002000 // Enable the buff/debuff bar on ML clients >= 5.0.2b
// OF_NoPrefix            00004000 // Add prefix "A" and "An" to itemnames or not
// OF_DyeType            00008000 // if set allows using i_dye on all t_dye_vat instead of only i_dye_tub
// OF_DrinkIsFood        00010000 // type T_DRINK will increase FOOD lvl like T_FOOD
// OF_DClickNoTurn        00020000 // the player won't turn when dclick or targ an item
// OF_Specific            01000000 // Specific behaviour, not completly tested

OF_FileCommands is what you need
09-29-2015 01:37 AM
Find all posts by this user Like Post Quote this message in a reply
Criminal
Journeyman
*

Posts: 182
Likes Given: 38
Likes Received: 22 in 22 posts
Joined: Jun 2015
Reputation: 0

SantiagoUO.com

Post: #3
RE: SERV.WRITEFILE???
[FUNCTION DELETEFILE]
IF !(<FILE.INUSE>)
FILE.MODE.APPEND=1
FILE.DELETEFILE <ARGS>
FILE.CLOSE
ENDIF

[FUNCTION WRITEFILE]
IF !(<FILE.INUSE>)
FILE.MODE.CREATE=1
FILE.MODE.APPEND=1
FILE.MODE.WRITEFLAG=1
IF (<FILE.OPEN <STRARG <ARGS>>>)
FILE.WRITELINE <STREAT <ARGS>>
FILE.CLOSE
ENDIF
ENDIF

[Image: mfqAZnj.png]
Discord: SantiagoUO
Skype:
criminaluo
09-29-2015 05:57 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #4
RE: SERV.WRITEFILE???
(09-29-2015 05:57 AM)Criminal Wrote:  [FUNCTION DELETEFILE]
IF !(<FILE.INUSE>)
FILE.MODE.APPEND=1
FILE.DELETEFILE <ARGS>
FILE.CLOSE
ENDIF

[FUNCTION WRITEFILE]
IF !(<FILE.INUSE>)
FILE.MODE.CREATE=1
FILE.MODE.APPEND=1
FILE.MODE.WRITEFLAG=1
IF (<FILE.OPEN <STRARG <ARGS>>>)
FILE.WRITELINE <STREAT <ARGS>>
FILE.CLOSE
ENDIF
ENDIF

Best way is to use these functions, here you have an example:

writefile scripts\test.scp,example_text_made_by=<name> //writefile script_file_name,data. Using this comma is mandatory.

This will output 'example_text_made_by=your_name'
09-29-2015 04:49 PM
Find all posts by this user Like Post Quote this message in a reply
Llirik
Journeyman
*

Posts: 116
Likes Given: 0
Likes Received: 10 in 8 posts
Joined: Feb 2015
Reputation: 0

UO Forum

Post: #5
RE: SERV.WRITEFILE???
Thank you!
09-30-2015 07:37 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
invernizzi
Apprentice
*

Posts: 24
Likes Given: 8
Likes Received: 1 in 1 posts
Joined: Jul 2016
Reputation: 0



Post: #6
RE: SERV.WRITEFILE???
Thx a lot!

[Image: banner_2.jpg]
12-29-2016 09:59 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)