sits.mac - slightly improved ts.mac

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

User avatar
Slice
a hill giant
a hill giant
Posts: 189
Joined: Wed Oct 30, 2002 2:52 pm

Post by Slice » Wed Sep 03, 2003 10:44 am

Just to add more detail, if I throw out a command line like this (Just for testing, it's an invalid combine)

/macro sits forge "#water" "#water"

I get the following messages:

[MacroQuest] Setting to unlimited attempts!
Item 'Forge' targetted.
[MacroQuest] Cannot find container << forge >>

Same thing happens for a Kiln.

Works great for containers in my inventory, just fails on environmental containers.

Slice

DontShoot
a lesser mummy
a lesser mummy
Posts: 58
Joined: Thu Jun 20, 2002 11:20 am

Post by DontShoot » Wed Sep 03, 2003 2:30 pm

Got a problem since I DL'd the new MQ...
[Wed Sep 03 13:48:57 2003] [MacroQuest] Setting to unlimited attempts!
[Wed Sep 03 13:48:57 2003] Ending macro: Failed to parse /if command
[Wed Sep 03 13:48:57 2003] ts.mac@333 (CombFind): /if n $l2==1 /if "$pack($l3,name)"=="$l1" /varset v2 $l3
[Wed Sep 03 13:48:57 2003] ts.mac@122 (Main): /call CombFind "$p1"
[Wed Sep 03 13:48:57 2003] Cleared the following: Timers Vars Arrays
[Wed Sep 03 13:48:57 2003] The current macro has ended.
[Wed Sep 03 13:48:57 2003] Usage:
[Wed Sep 03 13:48:57 2003] /if <condition> <command>
[Wed Sep 03 13:48:57 2003] <condition> : (<condition> && <condition>) or [n] <a>==<b>
any ideas?

User avatar
Slice
a hill giant
a hill giant
Posts: 189
Joined: Wed Oct 30, 2002 2:52 pm

Post by Slice » Wed Sep 03, 2003 2:58 pm

Make sure you have 8 containers in your inventory. You probably had a blank spot in your inventory.

Slice

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Wed Sep 03, 2003 3:14 pm

Having less than 8 containers has no effect on this macro.
I know that envormental combiners are having issues at the moment, it can be solved rather simple with the following:
Find:

Code: Select all

Sub OpenEnv
	/varset CombInt e
	/varset CombStr enviro
	/face item
Replace:

Code: Select all

Sub OpenEnv
	/varset CombInt e
	/varset CombStr enviro
	|/face item

Find:

Code: Select all

	/if n $CombInt==99 {
		/itemtarget $p0
		/if n $ground(id)==0 /varset CombInt 99
		/if n $distance(item)>20 /varset CombInt 98
		/if n $ground(id)>0 /if n $distance(item)<=20 /varset CombInt 8
	}
Replace:

Code: Select all

	/if n $CombInt==99 {
		/if "$l1"=="enviro" /varset CombInt 8
		/if n $CombInt!=8 /itemtarget $p0
		/if n $CombInt!=8 /if n $ground(id)==0 /varset CombInt 99
		/if n $CombInt!=8 /if n $distance(item)>20 /varset CombInt 98
		/if n $CombInt!=8 /if n $ground(id)>0 /if n $distance(item)<=20 /varset CombInt 8
	}
Now you simply just use "enviro" as combiner name when using forge, brew barrel etc.

User avatar
Slice
a hill giant
a hill giant
Posts: 189
Joined: Wed Oct 30, 2002 2:52 pm

Post by Slice » Wed Sep 03, 2003 6:20 pm

Thanks for the workaround on the environmental containers.

btw, I just retested and it may be another side effect of the 8-26 patch but you will indeed get the error that DontShoot mentioned if you have less then 8 containers in your inventory.

Slice

Achy Wrists
a lesser mummy
a lesser mummy
Posts: 36
Joined: Wed Aug 27, 2003 4:17 pm

Post by Achy Wrists » Wed Sep 03, 2003 7:27 pm

I made the modifications to sits.mac that Kagonis mentions to fix environmental containers, but I get this error now. I think it's the same as DontShoot's?

[MacroQuest] Setting to unlimited attempts!
Ending macro: Failed to parse /if command
tsenv.mac@333 (CombFind): /if n $l2==1 /if "$pack($l3,name)"=="$l1" /varset v2 $l3
tsenv.mac@122 (Main): /call CombFind "$p1"
Cleared the following: Timers Vars Arrays
The current macro has ended.
Usage:
/if <condition> <command>
<condition> : (<condition> && <condition>) or [n] <a>==<b>

I was trying to run /macro tsenv.mac 0 "enviro" "Stuff" "Stuff"

Achy Wrists
a lesser mummy
a lesser mummy
Posts: 36
Joined: Wed Aug 27, 2003 4:17 pm

Post by Achy Wrists » Wed Sep 03, 2003 11:14 pm

Added an 8th container to my inventory and this works now with a brew barrel.

DontShoot
a lesser mummy
a lesser mummy
Posts: 58
Joined: Thu Jun 20, 2002 11:20 am

Post by DontShoot » Thu Sep 04, 2003 12:59 am

now I'm getting a message "couldn't find comparison operator in 'nullo'"

this occurs while trying to use the forge

User avatar
Slice
a hill giant
a hill giant
Posts: 189
Joined: Wed Oct 30, 2002 2:52 pm

Post by Slice » Thu Sep 04, 2003 9:52 am

I get the same message DontShoot but the actual combines work. I just consider the error message a side effect of the 8-26 patch and the workarounds. It'll get fixed eventually.

Slice

topgun
a lesser mummy
a lesser mummy
Posts: 43
Joined: Thu Jan 09, 2003 8:27 am

Post by topgun » Thu Sep 04, 2003 1:03 pm

I patched my ts.mac like kagonis has posted. Still got the error. Then i filled up with 8 bags, and now the cursor moves. But no items are moved, it just jumps around as it should do with no clicking. And everytime it "clicks" combine the following error comes

"couldn't find comparison operator in 'nullo'"

Achy Wrists
a lesser mummy
a lesser mummy
Posts: 36
Joined: Wed Aug 27, 2003 4:17 pm

Post by Achy Wrists » Thu Sep 04, 2003 1:46 pm

Clicking on items only works if you're running EQW and have released the mouse at this time.

fryfrog
a hill giant
a hill giant
Posts: 271
Joined: Fri Jun 20, 2003 5:37 am

Post by fryfrog » Fri Sep 05, 2003 12:53 am

Are your changes backwards compatible, if some time in the future its all working again? I was trying to imagine it... but I'd much rather hear it from the horses mouth :)
kagonis wrote:Having less than 8 containers has no effect on this macro.
I know that envormental combiners are having issues at the moment, it can be solved rather simple with the following:
Find:

Code: Select all

Sub OpenEnv
	/varset CombInt e
	/varset CombStr enviro
	/face item
Replace:

Code: Select all

Sub OpenEnv
	/varset CombInt e
	/varset CombStr enviro
	|/face item

Find:

Code: Select all

	/if n $CombInt==99 {
		/itemtarget $p0
		/if n $ground(id)==0 /varset CombInt 99
		/if n $distance(item)>20 /varset CombInt 98
		/if n $ground(id)>0 /if n $distance(item)<=20 /varset CombInt 8
	}
Replace:

Code: Select all

	/if n $CombInt==99 {
		/if "$l1"=="enviro" /varset CombInt 8
		/if n $CombInt!=8 /itemtarget $p0
		/if n $CombInt!=8 /if n $ground(id)==0 /varset CombInt 99
		/if n $CombInt!=8 /if n $distance(item)>20 /varset CombInt 98
		/if n $CombInt!=8 /if n $ground(id)>0 /if n $distance(item)<=20 /varset CombInt 8
	}
Now you simply just use "enviro" as combiner name when using forge, brew barrel etc.

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Fri Sep 05, 2003 1:28 am

If you open all containers, and the enviromental combiner, as you allways do, then the changes don't really care about any future changes.

I basically just removed anything that actually relied on having an item targeted (the /face item I commented out), and added a enviro option that simply just overrides all enviromental combiner options, and assumes that you are having an enviromental combiner opened allready.

The only reason there is to even leave the old code for various envormental combiners, is if /click item etc is gonna work again, for automatic targeting and opening of containers.

If we assume that all users -allways- open all the containers etc. before starting the macro, then we could actually cut way down on the code in this script.

Could basically remove the following sub routines (pending a few changes in the rest of the code offcourse)..
HandlePacks, OpenInv, OpenEnv.

This was actually a longer answer than intended :p

Anyway, while I'm at it, I am trying to modify the way options are handled, but was kinda stopped.

It seems that $arg is somehow causing EQ to crash, I havent figured out how to make it show me what made it crash :p

Here is the development code that I keep telling myself should work, but due to the crashing of EQ the development of this code has been at a standstill for quite a bit now.

For debugging you could edit the ParseArgs routine to echo out instead of actually setting a variable.

If anyone get it working, I only ask them to post it here so that everyone can benefit from it.

Code: Select all

#define dly v0
#define abt v1
#define ShowStats v2
#define DesiredSuccesses v3
#define EndOnTrivial v4
#define FinishedProduct v5

Sub Main
|** DEFAULTS **|
	/varset ShowStats 1
	/varset EndOnTrivial 0
	/varset dly 2
	/varset abt 0
	/varset FinishedProduct "keep"
	/varset DesiredSuccesses 0
|** DEFAULTS **|

	/if "$p0"=="" /call ExecError
	/if "$p0"=="help" /call ShowHelp
	/call ParseArgs "$p0"
/return

Sub ParseArgs
	/if "$p0"=="" {
		/echo Syntax: /call ParseArgs "space seperated string of arguments"
		/endmacro
	}
	/call CountArgs "$p0"
	/for l0 1 to $return
		/varset l1 $left($instr("=","$arg($l0,"$p0")"),"$arg($l0,"$p0")")
		/varset l2 $right($calc($strlen("$arg($l0,"$p0")")-$instr("=","$arg($l0,"$p0")")-1),$arg($l0,"$p0"))
		/if "$l1"=="default" /goto :EndOptions
		/if "$l1"=="combines" /varset DesiredSuccesses $int($l2)
		/if "$l1"=="delay" /varset dly $int($l2)
		/if "$l1"=="end-on-trivial" /varset EndOnTrivial $int($l2)
		/if "$l1"=="abort-on-tell" /varset abt $int($l2)
		/if "$l1"=="destroy" /if n $l2==1 /varset FinishedProduct "destroy"
		/if "$l1"=="show-stats" /varset ShowStats $int($l2)
		/varadd l0 1
		/if n $l0>7 /goto :EndOptions
	/next l0
	:EndOptions
/return

Sub CountArgs
	/if "$p0"=="" {
		/echo Syntax: /call CountArgs "space seperated string of arguments"
		/endmacro
	}
	/varset l0 1
	/varset l1 1
	:Loop
		/if "$mid($int($l1),1,"$p0")"==" " /varadd l0 1
		/varadd l1 1
	/if n $l1<$strLen("$p0") /goto :Loop
/return $l0

Sub ExecError
		/echo Syntax error.
		/echo Type the following for more help:
		/echo /macro ts "help"
		/endmacro
/return

Sub ShowHelp
	/echo Syntax: /macro ts <options> <CombinerName> <Component> [Component]...
	/echo Example: /macro ts "show-stats=0 destroy=0 abort-on-tell=0 end-on-trivial=0" "Sewing Kit" "Spider Silk" "Spider Silk"
	/echo -
	/echo Options:
	/echo --------
	/echo * show-stats
	/echo -- Syntax: show-stats=1|0
	/echo -- Example: show-stats=0
	/echo -- Shows combine statistics.
	/echo -- Set to 1 for show showing stats, 0 to leave out the stats.
	/echo -- Default set to 1 (show stats).
	/echo -
	/echo * destroy
	/echo -- Syntax: destroy=1|0
	/echo -- Example: destroy=1
	/echo -- Tells the macro wether end-result is destroyed or kept.
	/echo -- Set to 1 for destroying end-result, 1 to keep end-result.
	/echo -- Default set to 0 (keep end-result).
	/echo -
	/echo * abort-on-tell
	/echo -- Syntax: abort-on-tell=1|0
	/echo -- Example: abort-on-tell=1
	/echo -- Tell the macro wether it should /endmacro when recieving a tell.
	/echo -- Set to 1 for ending macro on tells, 0 to ignore tells.
	/echo -- Default set to 0 (ignore tells).
	/echo -
	/echo * end-on-trivial
	/echo -- Syntax: end-on-trivial=1|0
	/echo -- Example: end-on-trivial=1
	/echo -- Tell the macro wether it should stop combines when recieving a trivial message.
	/echo -- Set to 1 for ending macro on trivial, 0 to ignore trivial.
	/echo -- Default set to 0 (ignore trivial).
	/echo -
	/echo * delay
	/echo -- Syntax: delay=#
	/echo -- Example: delay=4
	/echo -- The delay between mouse commands in the macro.
	/echo -- Increase this number to make the macro combine slower, but more safely. Decrease the number to combine faster, but more prone to errors.
	/echo -- Default set to 2 (this is as fast as it has been tested to be able to go)
	/echo -
	/echo * combines
	/echo -- Syntax: combine=#
	/echo -- Example: combine=100
	/echo -- The number of successfull combines you want made (or till no more components are available).
	/echo -- Set to 0 for unlimited combines (or till no more components are available), or to the wanted amount.
	/echo -- Default set to 0 (unlimited).
	/echo -
	/echo * default
	/echo -- Syntax: default
	/echo -- Tell the macro to use all default settings, any other options set will be ignored and defaults will be used.
	/endmacro
/return

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Fri Sep 05, 2003 8:10 am

/click left|right item is fixed in cvs.

topgun
a lesser mummy
a lesser mummy
Posts: 43
Joined: Thu Jan 09, 2003 8:27 am

Post by topgun » Sat Sep 06, 2003 5:10 am

Just updated from cvs, and compiled new version but no change for me... trying the eqw trick now