Syntax Help

Moderator: MacroQuest Developers

Red-One
a ghoul
a ghoul
Posts: 143
Joined: Tue Dec 28, 2004 9:14 pm

Syntax Help

Post by Red-One » Thu Jul 07, 2005 7:10 pm

Is this valid?

Code: Select all

ini_MasterName:Set[$Ini[INI_FILENAME, MASTERLIST, Master, NOT_FOUND]}] 

INI_FILENAME correctly resolves to bot_name before it hits this. I have the ini with section MASTERLIST and Master=Toon. I've tried putting the ini file in both the scritps and extensions folder, no luck. when I echo ini_MasterName or echo just $Ini[INI_FILENAME, MASTERLIST, Master, NOT_FOUND]}] it always returns NULL, so i'm assuming it isn't even location the file.

Thanks,

-Red

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu Jul 07, 2005 8:28 pm

No. Data sequences use ${ not just $. If you're getting NULL, then something doesnt exist in the first place. I assume "ini_MasterName" is a string variable?
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Red-One
a ghoul
a ghoul
Posts: 143
Joined: Tue Dec 28, 2004 9:14 pm

Post by Red-One » Thu Jul 07, 2005 9:04 pm

Yeah, here is my declare section.

Code: Select all

                declare ini_MasterName string global
	declare ini_ChatInChan string global
	declare ini_ChatOutChan string global
	declare bv_DoFollow int global 0



Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu Jul 07, 2005 9:18 pm

They really should be "script" scope, not global.

But anyway, I just realized the issue. The problem is that the Ini TLO for ISXEQ is not enabled. You should use the XML settings system implemented in Inner Space instead. See the SettingXML TLO, settingxml data type, dataset data type.. start here: http://www.lavishsoft.com/wiki/index.ph ... _Object%29

There's examples of usage in scripts on ismods.com
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Red-One
a ghoul
a ghoul
Posts: 143
Joined: Tue Dec 28, 2004 9:14 pm

Post by Red-One » Thu Jul 07, 2005 9:30 pm

Ok, I'll switch it to XML (Honestly, I was already looking at it because I was pissed about INI not working, :wink: ).

On a side note, is there no ${Spawn[]} TLO?
I'm running some tests on basic things, and getting wierd results.

I have 2 machines up with toons logged in, one running MQ2 and one running ISXEQ and ISXEQCHATWND.

MQ2:

Code: Select all

/echo ${Me.ID}

...is a correct number

/echo ${Spawn[MyToonName].ID}

...is a correct number

ISXEQ with ISXEQCHATWND

Code: Select all

/echo ${Me.ID}

...is a correct number

/echo ${Spawn[MyToonName].ID}

...is NULL
Since the DLL's need to be loaded individually, is there one that I am missing to load for ${Spawn[]} to work?

It seems wierd, because I thought ${Me} inherited from spawn.

-Red

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Thu Jul 07, 2005 9:37 pm

well, the spawn TYPE can work fine, and character type DOES inherit spawn. But, types are different from objects. The Spawn TLO *should* work.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Red-One
a ghoul
a ghoul
Posts: 143
Joined: Tue Dec 28, 2004 9:14 pm

Post by Red-One » Thu Jul 07, 2005 9:58 pm

Well, here is what I got that is wierding out on me.

Code: Select all

AddTrigger bf_Chat "@Player@ tells you, '@Command@'"
....


function bf_Chat(string FullLine, string Player, string Command)
{

	echo In chat trigger with ${FullLine} and ${Player} and ${Command}

	if "${Player.Equal[${MasterName}]}"
	{
		echo ${Player} match for follow
		
		if "${Command.Equal["follow"]}"
		{
			bv_DoFollow:Set[1]
			call bf_Follow ${Player}

		}
		if "${Command.Equal["stay"]}"
		{
			bv_DoFollow:Set[0]
		}
	}
	return
}

function bf_Follow(string Player)
{
	

	if "${Spawn[${Player}].ID}"
	{
		${Spawn[${Player}]}:Target
	}
	else
	{
		echo Could not find spawn ${Player} to follow
		return
	}

	do
	{
		echo In follow function, looking for ${Player}
		ExecuteQueued
		face
		if "${Spawn[${Player}].Distance} > 20"
		{
			keypress forward
			keypress forward hold
		}
		else
		{
			keypress back
		}
	}
	while ${bv_DoFollow}

	return
}


My output is:

Code: Select all

In chat trigger with ToonName tells you, 'follow' and ToonName and follow
ToonName match for follow
Could not find spawn ToonName to follow

Now, I am kinda cheating while testing this. I am sending the tell to another toon, but I am not in the zone (I'm doing this while raiding, :wink: ). I compensate for this by setting player to a PC that is sitting afk near by. In this example, the ToonName is Argo.

Code: Select all

${Player}:Set[Argo]
or
${Player}:Set["Argo"]
I do that in the beginning of bf_Follow

Is it me?

edit: I'll just refrain from using words like TLO, TYPE, METHOD, MEMBER, etc... I can never get them straight. When I think I do, I end up using it in the wrong context. :wink: I'm trying to learn though.


-Red

Red-One
a ghoul
a ghoul
Posts: 143
Joined: Tue Dec 28, 2004 9:14 pm

Post by Red-One » Thu Jul 07, 2005 10:12 pm

... And I am using the latest IS, and the jul 5th ISXEQ/CHATWND compiled with ISXDK v13 :wink:


-Red

Red-One
a ghoul
a ghoul
Posts: 143
Joined: Tue Dec 28, 2004 9:14 pm

Post by Red-One » Fri Jul 08, 2005 8:13 am

onetimehero pointed out what might be an error in ISXEQUtilities around line 206, that doesn't compensate for case when searching for a spawn match in the zone.

I had to go with

Code: Select all

noop ${Spawn[pc,${Player.Lower}]:Target
Just ${Spawn[${Player}]:Target would not work. Now I'm trying to use :Face and that does not seem to be working correctly either. I poked around in DataTypes and in the case statement for face and face fast it says:

Code: Select all

//TO DO
So I'm not sure if it doesn't exist or if it is unrelated. :wink:

Code: Select all

noop ${Spawn[pc,${Player.Lower}]:Face}
noop ${Spawn[pc,${Player.Lower}]:Face[fast]}
noop ${Spawn[pc,${Player.Lower}]:Target:Face}
noop ${Spawn[pc,${Player.Lower}]:Target:Face[fast]}
(None of these /face)
It would make me think it doesn't exist (or it exists since it is not returning NULL, but functionality is missing) since all of these return the character name, but do not turn the toon to face anything. :wink:

Any help would be super.

-Red

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Fri Jul 08, 2005 9:24 am

No need to use noop in this situation, you can use methods directly as commands, like this:

Code: Select all

Spawn[pc,${Player.Lower}]:Face
etc. Note the lack of outer ${. The lower case thing is fixed in cvs
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

onetimehero
a ghoul
a ghoul
Posts: 105
Joined: Fri Sep 05, 2003 2:42 pm

code for Spawn:Face

Post by onetimehero » Fri Jul 08, 2005 9:55 am

Here's what I have for the :Face method. You can :Face[fast,nolook,predict,away]. I also have :LeftClick and :RightClick members.

Code: Select all

	case Face:
		{
			PSPAWNINFO pSpawn = (PSPAWNINFO)GetSpawnByID(pPtr->SpawnID);
			if (pSpawn->SpawnID==((PSPAWNINFO)pCharSpawn)->SpawnID)   // If it is ourself, don't do anything.
				return true;
			bool bfPredict=false;
			bool bfAway=false;
			bool bfNolook=false;
			bool bfFast=false;
			gFaceAngle = (
				atan2(pSpawn->X - ((PSPAWNINFO)pCharSpawn)->X,
				pSpawn->Y - ((PSPAWNINFO)pCharSpawn)->Y)
				* 256.0f / PI);
			while (argc--)
			{
				if (!stricmp(argv[argc],"predict"))
					bfPredict=true;
				else if (!stricmp(argv[argc],"nolook"))
					bfNolook=true;
				else if (!stricmp(argv[argc],"away"))
					bfAway=true;
				else if (!stricmp(argv[argc],"fast"))
					bfFast=true;
			}
			if (bfPredict)
			{
				DOUBLE Distance;
				Distance = DistanceToSpawn((PSPAWNINFO)pCharSpawn, pSpawn);
				gFaceAngle = (
					atan2((pSpawn->X + (pSpawn->SpeedX * Distance)) - ((PSPAWNINFO)pCharSpawn)->X,
					(pSpawn->Y + (pSpawn->SpeedY * Distance)) - ((PSPAWNINFO)pCharSpawn)->Y)
					* 256.0f / PI);
			}
			if (!bfNolook) {
				DOUBLE Distance = DistanceToSpawn((PSPAWNINFO)pCharSpawn, pSpawn);
				gLookAngle = (
					atan2(pSpawn->Z + pSpawn->AvatarHeight*StateHeightMultiplier(pSpawn->StandState) - ((PSPAWNINFO)pCharSpawn)->Z - 
					((PSPAWNINFO)pCharSpawn)->AvatarHeight*StateHeightMultiplier(((PSPAWNINFO)pCharSpawn)->StandState), 
					(FLOAT)Distance) 
					* 256.0f / PI);
				if (bfAway) gLookAngle = -gLookAngle;
				if (bfFast) {
					((PSPAWNINFO)pCharSpawn)->CameraAngle = (FLOAT)gLookAngle;
					gLookAngle=10000.0f;
				}
			}
			if (bfAway) {
				gFaceAngle += 256.0f;
			}
			if (gFaceAngle>=512.0f) gFaceAngle -= 512.0f;
			if (gFaceAngle<0.0f) gFaceAngle += 512.0f;
			if (bfFast) {
				((PSPAWNINFO)pCharSpawn)->Heading = (FLOAT)gFaceAngle;
				gFaceAngle=10000.0f;
			}
		}
		return true;

	case LeftClick:
		{
		PSPAWNINFO pSpawn = (PSPAWNINFO)GetSpawnByID(pPtr->SpawnID);
		pEverQuest->LeftClickedOnPlayer((EQPlayer *)pSpawn);
		return true;
		}
	case RightClick:
		{
		PSPAWNINFO pSpawn = (PSPAWNINFO)GetSpawnByID(pPtr->SpawnID);
		pEverQuest->RightClickedOnPlayer((EQPlayer *)pSpawn);
		return true;
		}

Hmm. That's odd.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Fri Jul 08, 2005 10:10 am

cvs'd.

anything else you have lying around that should be put in? ;)
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Red-One
a ghoul
a ghoul
Posts: 143
Joined: Tue Dec 28, 2004 9:14 pm

Post by Red-One » Fri Jul 08, 2005 10:11 am

No need to use noop in this situation, you can use methods directly as commands, like this:

Code: Select all

Spawn[pc,${Player.Lower}]:Face


etc. Note the lack of outer ${. The lower case thing is fixed in cvs
So does that also holds true for :Target and other methods in the data sequence (yay for me with new terms!)?

Code: Select all

Spawn[pc,${Player.Lower}]:Target
Spawn[pc,${Player.Lower}]:Target:Face
Spawn[pc,${Player.Lower}]:Target:Face[fast]
I guess I'm assuming that without the ${ for spawn that it is not returning string object, instead it is just doing the method on the member (am I using these terms right?) given the data type?

Thanks both of you, I think I can now fix my script and add some functionality. :wink:

-Red
[/code]

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Fri Jul 08, 2005 10:16 am

RedOneDI wrote:So does that also holds true for :Target and other methods in the data sequence (yay for me with new terms!)?
of course!
I guess I'm assuming that without the ${ for spawn that it is not returning string object, instead it is just doing the method on the member (am I using these terms right?) given the data type?
It never would have returned a string object, just the text. And you're not doing a method on a member because you're not using a member, just methods in your post -- you do methods on objects, and you access members of objects. But other than the usage of terms, you're probably thinking correctly :)

Spawn[pc,${Player.Lower}]:Target - Target spawn
Spawn[pc,${Player.Lower}]:Target:Face - Target spawn, then face
Spawn[pc,${Player.Lower}]:Target:Face[fast] - Target spawn, then face fast
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Red-One
a ghoul
a ghoul
Posts: 143
Joined: Tue Dec 28, 2004 9:14 pm

Post by Red-One » Fri Jul 08, 2005 10:53 am

But other than the usage of terms, you're probably thinking correctly :)
I knew I took that sentence too far. :?


-Red