View previous topic :: View next topic |
Author |
Message |
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Tue Sep 04, 2007 0:01 Post subject: |
|
|
Urlord wrote: | Can parameters be passed in to bat/cmd files? If so, an example please? |
Yes, read your help doco for a full explanation. [Search: "Batch files"]
my.bat "my Param 1" "In 2"
--to get the values (from within the patch file)
set p1 = %1
set p2 = %2
a SpawnCommand string would need to look something like
"""my bat"" ""my Param 1"" ""In 2"""
Cheers
Gryphyn |
|
Back to top |
|
|
Urlord
Joined: 17 Nov 2006 Posts: 122
|
Posted: Mon Apr 13, 2009 3:01 Post subject: |
|
|
The Spawn Plugin 106.108.1.1 has stopped working since the NWN2 Patch 1.22.1588. Is there another version? _________________ Jim (aka, Urlord)
Visit the Persistent World of Nymri |
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Mon Apr 13, 2009 3:36 Post subject: |
|
|
Urlord wrote: | The Spawn Plugin 106.108.1.1 has stopped working since the NWN2 Patch 1.22.1588. Is there another version? |
I'll have a look into it...
OK, I've upgraded and recompiled - all my tests passed.
xp_spawn.dll (106.109.1.22) is the new 'download-able'
It works with NWNX^4 1.09 and NWN2 1.22.
If you still have issues can you PM/Post the log files I might be able to spot something I missed.
Cheers
Gryphyn |
|
Back to top |
|
|
Urlord
Joined: 17 Nov 2006 Posts: 122
|
Posted: Mon Apr 13, 2009 6:52 Post subject: |
|
|
Hey Gryphyn,
Thanks for responding so quickly. I installed the latest dll and it still isn't working. Below is the log file. For the life of me I cannot find anything wrong with the command.
Quote: | NWNX Spawn Plugin V.106.108.1.1
(c) 2007 by Rob Lobbe (Gryphyn)
visit us at http://www.nwnx.org
* Plugin initialized.
* Spawn Command: "C:\WINDOWS\system32\cmd.exe" /C "del /F/Q ""C:\Documents and Settings\nymri\My Documents\Neverwinter Nights 2\servervault\Urlord\testuraak.*"""
* Spawn Result: 3748
|
Here is the script that executed the command:
Code: |
#include "hcr2_core_i"
#include "nwnx_spawn"
void main()
{
object oPC = GetPCSpeaker();
object oModule = GetModule();
string sPCID = GetExternalPCID(oPC);
string sPlayerName = GetPCPlayerName(oPC);
string sBicFileName = GetStringLowerCase(GetFirstName(oPC)+GetLastName(oPC));
string sCommand = SpawnQuote("del /F/Q " + SpawnQuote(SpawnEscape("C:|Documents and Settings|nymri|My Documents|Neverwinter Nights 2|servervault|"+sPlayerName+"|"+sBicFileName+".*")));
int nRegisteredCharCount = h2_GetRegisteredCharCount(oPC);
SetLocalInt(oPC, "I_AM_RETIRED", 1);
SQLExecDirect("call retire_pc(" + sPCID + ")");
SendMessageToPC(oPC, H2_TEXT_TOTAL_REGISTERED_CHARS + IntToString(nRegisteredCharCount));
SendMessageToPC(oPC, H2_TEXT_MAX_REGISTERED_CHARS + IntToString(H2_REGISTERED_CHARACTERS_ALLOWED));
SendMessageToPC(oPC, "You'll be booted in 6 seconds, and your character will be deleted from the vault!");
WriteTimestampedLogEntry("Retiring PC: " + sCommand);
AssignCommand(oModule, DelayCommand(6.0, BootPC(oPC)));
AssignCommand(oModule, DelayCommand(10.0, SpawnCommand(sCommand, 0)));
}
|
If it matters, this an AMD Athlon 6400+ running Windows XP64
I look forward to your response. _________________ Jim (aka, Urlord)
Visit the Persistent World of Nymri |
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Mon Apr 13, 2009 17:21 Post subject: |
|
|
OK, not sure about x64.
but I note your getting cmd via \System32\ folder?
Give me another try at uploading the DLL,
you should see a new version number V.122.109.1.1 in the log
Cheers
Gryphyn |
|
Back to top |
|
|
Urlord
Joined: 17 Nov 2006 Posts: 122
|
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Tue Apr 14, 2009 7:30 Post subject: |
|
|
Urlord wrote: | I got the dll again and it is still the 108 version. |
Finally got v122.109.1.1 uploaded.
I had to refresh my cache to get the new version - it kept using the cached version. |
|
Back to top |
|
|
Urlord
Joined: 17 Nov 2006 Posts: 122
|
Posted: Tue Apr 14, 2009 7:47 Post subject: |
|
|
I am not sure what I am doing wrong then, because it still shows the following in the log file.
Code: | NWNX Spawn Plugin V.106.108.1.1
(c) 2007 by Rob Lobbe (Gryphyn)
visit us at http://www.nwnx.org
* Plugin initialized. |
I just downloaded it again too after your last post.
If you want to zip it up and email it to me, send it to Urlord@WizardStorm.com please. Please zip it up or my virus program will stop it due to the DLL attachment. _________________ Jim (aka, Urlord)
Visit the Persistent World of Nymri |
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Tue Apr 14, 2009 8:44 Post subject: |
|
|
sent |
|
Back to top |
|
|
Urlord
Joined: 17 Nov 2006 Posts: 122
|
Posted: Tue Apr 14, 2009 8:57 Post subject: |
|
|
Dang - Now that I have the right version installed it still doesn't work. Here is the log:
Quote: |
NWNX Spawn Plugin v122.109.1.1
(c) 2007-2009 by Rob Lobbe (Gryphyn)
visit us at http://www.nwnx.org
* Plugin initialized.
* Spawn Command: "C:\WINDOWS\system32\cmd.exe" /C "del /F/Q ""C:\Documents and Settings\nymri\My Documents\Neverwinter Nights 2\servervault\Urlord\testuraak.*"""
* Spawn Result: 1936
|
What does * Spawn Result: 1936" mean?
Oh, the system32 is right. That is where cmd.exe is located. I tested the spawn command on the command line and I got it working ny deleting some of the quotes. Here is the line that worked:
C:\WINDOWS\system32\cmd.exe /C del /F/Q "C:\Documents and Settings\nymri\My Documents\Neverwinter Nights 2\servervault\Urlord\testuraak.*"
So I tried modifying my code from this:
Code: | string sCommand = SpawnQuote("del /F/Q " + SpawnQuote(SpawnEscape("C:|Documents and Settings|nymri|My Documents|Neverwinter Nights 2|servervault|"+sPlayerName+"|"+sBicFileName+".*"))); |
to this:
Code: | string sCommand = "del /F/Q " + SpawnQuote(SpawnEscape("C:|Documents and Settings|nymri|My Documents|Neverwinter Nights 2|servervault|"+sPlayerName+"|"+sBicFileName+".*")); |
And it worked. I am not sure what changed so that it worked at one point and then stopped. But, it is working now.
Thanks for all your help and your quick response. If I could buy you a beer, I would. _________________ Jim (aka, Urlord)
Visit the Persistent World of Nymri |
|
Back to top |
|
|
Gryphyn
Joined: 20 Jan 2005 Posts: 431
|
Posted: Tue Apr 14, 2009 12:51 Post subject: |
|
|
NP, I'll have this one
Not sure what changed - but getting those quotes right is the tricky bit, especially when you have to double-up to escape them...
I usually get the cmd working outside the game before trying it in nwscript, so I can tell where the quotes are needed.
And SpawnResult is the RESULT of the spawned command. So you can check if the command worked.
Cheers
Gryphyn |
|
Back to top |
|
|
|