logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Spawn Plugin v106.108.1.1
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Tue Sep 04, 2007 0:01    Post subject: Reply with quote

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
View user's profile Send private message
Urlord



Joined: 17 Nov 2006
Posts: 122

PostPosted: Mon Apr 13, 2009 3:01    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Mon Apr 13, 2009 3:36    Post subject: Reply with quote

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
View user's profile Send private message
Urlord



Joined: 17 Nov 2006
Posts: 122

PostPosted: Mon Apr 13, 2009 6:52    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Mon Apr 13, 2009 17:21    Post subject: Reply with quote

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
View user's profile Send private message
Urlord



Joined: 17 Nov 2006
Posts: 122

PostPosted: Tue Apr 14, 2009 4:17    Post subject: Reply with quote

I got the dll again and it is still the 108 version.
_________________
Jim (aka, Urlord)
Visit the Persistent World of Nymri
Back to top
View user's profile Send private message Send e-mail
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Tue Apr 14, 2009 7:30    Post subject: Reply with quote

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
View user's profile Send private message
Urlord



Joined: 17 Nov 2006
Posts: 122

PostPosted: Tue Apr 14, 2009 7:47    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Tue Apr 14, 2009 8:44    Post subject: Reply with quote

sent
Back to top
View user's profile Send private message
Urlord



Joined: 17 Nov 2006
Posts: 122

PostPosted: Tue Apr 14, 2009 8:57    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Tue Apr 14, 2009 12:51    Post subject: Reply with quote


NP, I'll have this one Wink

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group