Is /doability "Pick Pockets" working for anyone?

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

newb-n-training
a lesser mummy
a lesser mummy
Posts: 39
Joined: Mon Apr 19, 2004 8:51 pm

Is /doability "Pick Pockets" working for anyone?

Post by newb-n-training » Mon Apr 19, 2004 9:26 pm

I've searched and searched and have found no resolutions and only one other person even commenting that they're having this problem (tho I admittedly suck using these searches so if it's there I'd love to find it).

I'm wondering if I'm coding something wrong as I am very new to coding. This was working until the 4-15 patch ( I'm still using the old system to figure out what happened before I move to the 4-19 ver) but for whatever reason it's not working any longer:

Code: Select all

Sub AmFavpickpocket
	/if @PickpocketTimer==0 {
	   /attack off
|--	  /doability "Pick Pockets"
	   /call ChatOut 5 @MasterName "I tried to steal"      | put in to test

		/if "$cursor()"=="TRUE" {
			/call ChatOut 5 @MasterName "I stole $cursor(name)!"
			/call delay 1s
			/autoinv
			/call delay 1s
         	}

	   /attack on
	   /varset PickpocketTimer 15s
	   }
/return

I have my timer declared etc... and everything works as long as the line with /doability "Pick Pockets" is commented out. If it isn't I get errors of "You can't use that command now" or "You are too distracted to use a skill" when trying to click a hotbutton or combat ability (respectively). It essentially stops me from being able to use my mouse.

Is this a #turbo issue that just cropped up? Am I coding something wrong? Or is it as I suspect, some problem with the /doability specifically ?

All other instances of /doability work just fine. I get the same errors when using either
/doability 5
or
/doability "Pick Pockets"

Any input would be greatly appreciated.

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Mon Apr 19, 2004 9:55 pm

Not seeing anything scream at me here. Can you post the Sub Main or whereever this sub is called from?

newb-n-training
a lesser mummy
a lesser mummy
Posts: 39
Joined: Mon Apr 19, 2004 8:51 pm

Post by newb-n-training » Mon Apr 19, 2004 10:48 pm

Sure --

I suppose it would help if I just post everything as I've added it to genbot as god only knows if I'm even able to do all this ...

First in "Sub SetupPersonalVars" from genbot I've added a statement --
/call amcheckrogue
to create a set of variables defined only for rogues --

Code: Select all

Sub Amcheckrogue
   /if "$char(class)"=="Rogue" {
	/call ChatOut 5 @MasterName " Rogue $char(name) is at your service"
	#include botrogue.inc
   }
/return
(could using the #include cause problems perhaps? I've tried it both with and without this process with exactly the same result. Also, the other sub's built this way are working fine so I assumed it wasn't the code, but then I am a newb =)

In botrogue.inc I have added

Code: Select all

/declare amisrogue global
/varset amisrogue 1

/declare discactive global
/declare nimblepct global 
/declare escapepct global        
/declare strikedisc global        
/declare sneakhide global
/declare refreshsneakhide global
/declare regenendpct global     
/declare maxendurance global     

  
/varset discactive 0 		| Flag prevents more than 1 offensive disc per fight
/varset nimblepct 45 		| Use nimble disc when $char(hp,pct) <= this, 0 = off 
/varset escapepct 30		| Use escape ability when $char(hp,pct) <= this, 0 = off 
/varset strikedisc "Assassin" 	| Name of your best "strike" discipline (e.g. Assassin, Kyv, Ancient)
/varset sneakhide 1 		| Sneak Hide between kills; 1 = Yes, 0 = No 
/varset refreshsneakhide 1	| Used to flag whether or not sneak hide is ready for use 0 = is hidden, 1 = is not hidden
/varset regenendpct 20 		| Regen endurance to full when it gets low via $), 0 = off
/varset maxendurance 2560 	| Stores max endurance (use $char(endurance,cur) when your bar is full for value) 


|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||  
|
||----------- Timers ------------------


/declare PickpocketTimer timer
/declare DeadlyTimer timer
/declare DuelistTimer timer

/varset PickpocketTimer 0
/varset DeadlyTimer 0
/varset DuelistTimer 0

|||----------- End Timers -------------
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||  
In the main loop of personal.inc I added
/call MyAdditions
so here's all my additions (just seems simpler to sum all of my additions this way instead of adding all of the calls to the main loop but perhaps I shouldn't do that? )

Code: Select all

Sub MyAdditions

   /if "$char(invited)"==1 {
	/call delay 2s
	/keypress invite_follow
   }

   /if n @amisrogue==1 { 

||||----- When in Combat ---------------

      /if "$combat"=="TRUE" {	
	/call CheckAtkSpecial
	/call CheckDefSpecial 
	/call Amfavpickpocket
 
      } else {	

||||----- When Not in Combat -----------

	/call sneakhide
      }
    }        |--- just realized this was missing but still not working with it in ... same error
/return 

The other sub's being called (in case they are causing the conflict in some way)

Code: Select all

 
Sub SneakHide 
   /if n @sneakhide==1 {
      /if n @refreshsneakhide==1 {
	/if "$char(casting)"!="TRUE" {
		/if "$corpse()"!="TRUE" {
			/if "$banker(open)"!="TRUE" {
				/if "$merchant(open)"!="TRUE" {
				   /if n $char(ability,"Sneak")>0 /doability "Sneak"
				   /call delay 1s
				   /if n $char(ability,"Hide")>0 /doability "Hide"
				}
			}
		}
	}
      }
   }
/return 


Sub CheckAtkSpecial
   /if n @discactive==0 {
      /if n $calc($char(endurance,cur)/@maxendurance*100)>=@regenendpct) {
	/if n $target(hp,pct)>=65 {
	/if @DeadlyTimer==0 {
		/disc deadly
		/varset DeadlyTimer 5m
	} else {
		/if @DuelistTimer==0 {
		/disc duelist
		/varset DuelistTimer 22m
	}
        }
      }
      /if n $char(endurance,cur)>@maxendurance {
	/varset maxendurance $char(endurance,cur)
      }
   }
/return


Sub CheckDefSpecial 
   /if n $char(hp,pct)<=@nimblepct { 
      /if n $char(hp,pct)<=@escapepct { 
         /attack off 
         /alt activate 102
         /call SneakHide 
      } else { 
         /disc nimble 
         /attack off 
         /delay 5 
         /doability "Hide" 
      } 
   } 
/return 
Boy this didn't format very well, guess it's the tabs. I also have a few events triggered to set variables (yeah, maybe its a cheap hack way of doing it but I wanted to learn events and am still waiting for the new parm to try and learn that method before I try to get too deep into this system =)

Code: Select all

Sub Event_Amcamping 
    /endmacro 
/return

Sub Event_Amishidden  
    /varset refreshsneakhide 0
/return

Sub Event_Amisnothidden  
    /varset refreshsneakhide 1
/return

Sub Event_Amresethidden 
    /varset refreshsneakhide 1
/return

Sub Event_Stopsneaking 
    /varset refreshsneakhide 1
/return
Edit -- forgot the values set for each event ---

Code: Select all

#Event Amcamping "It will take about 10 more seconds to prepare your camp" 
#Event Amisnothidden "You have moved and are no longer hidden"
#Event Amishidden "You have hidden yourself from view"
#Event Amresethidden "LOADING, PLEASE WAIT"
#Event Stopsneaking "You stop sneaking"
I realize I simplified a lot of the changes I've made at the beginning of this post so really appreciate your even asking for more info. I have been troubleshooting this by commenting out code, removing all subs and slowly bringing them back in, etc... and again, this wasn't a problem before 4-15 so either I've changed something since then or there's something in EQ / MQ.

The only thing that seems to cause me problems is when I leave the
/doability "Pick Pockets"
instead of commenting it out. I'm wracking my brain here as to what it could be but am completely out of my league. Perhaps an issue with "Sneakhide" being both a variable and a sub? In writing this I realize I always brought that sub in first so perhaps there's a conflict ... hopefully it's a simple mistake on my part.

enough speculation for me ...and again, thanks for any input you can provide.

MrSmallie
a hill giant
a hill giant
Posts: 167
Joined: Fri Oct 11, 2002 11:18 am

Post by MrSmallie » Tue Apr 20, 2004 1:47 pm

Can you pickpockets with the Nimble Disc active?
Me
[img]http://home.comcast.net/~mrsmallie/ches.JPG[/img]

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Tue Apr 20, 2004 3:27 pm

Lots of info. I see a couple of things that jump out at me now.

Code: Select all

Sub Amcheckrogue 
   /if "$char(class)"=="Rogue" { 
   /call ChatOut 5 @MasterName " Rogue $char(name) is at your service" 
   [color=red]#include botrogue.inc [/color]
   } 
/return 
# lines should go at the top of your macro outside any subs. Having never tried putting one in a sub before I don't know if it would error or not but couldn't hurt by moving it.

Code: Select all

/varset PickpocketTimer 0 
/varset DeadlyTimer 0 
/varset DuelistTimer 0 
Okay, I can understand setting timers to 0 as an inital value, sorta, but why aren't you using /doevents timer to handle the timers. Instead you have AmFavpickpocket which you are calling constently, I assume, from your program loop.

Code: Select all

Sub AmFavpickpocket 
[color=red]   /if @PickpocketTimer==0 { [/color]      
      /attack off 
|--     /doability "Pick Pockets" 
      /call ChatOut 5 @MasterName "I tried to steal"      | put in to test 

      /if "$cursor()"=="TRUE" { 
         /call ChatOut 5 @MasterName "I stole $cursor(name)!" 
         /call delay 1s 
         /autoinv 
         /call delay 1s 
            } 

      /attack on 
      /varset PickpocketTimer 15s 
      } 
/return 
But that's just my wtf response. Try changing above red line to this and see if it helps.

Code: Select all

    /if n @PickpocketTimer==0 {
      /if n $char(ability,"Pick Pocket")>0 /doability "Pick Pocket"
The second IF statement could just replace the whole need for a timer, you don't need to add it... just something to get ya thinking =)
Perhaps an issue with "Sneakhide" being both a variable and a sub? In writing this I realize I always brought that sub in first so perhaps there's a conflict ... hopefully it's a simple mistake on my part.
Sub SneakHide and @sneakhide won't cause any conflicts because to MQ they aren't even the same word. MQ is case sensitive ((huge hint here, check your /call statement in MyAdditions)) and thus won't get confused between the two names.
Just for fun I'll pull up my rogue, dust her off, and see if /doability is giving and problem. I doubt it but I've got time today. As of yet, I don't see anything that would cause your character to become 'busy' which is what you described was happening :?

newb-n-training
a lesser mummy
a lesser mummy
Posts: 39
Joined: Mon Apr 19, 2004 8:51 pm

Post by newb-n-training » Tue Apr 20, 2004 4:21 pm

Again, thanks for another set of eyes and the quick response.

First -
/if n $char(ability,"Pick Pocket")>0 /doability "Pick Pocket"

I originally had it listed that way actually, but after reading the manual I thought the value of $char(ability,"XXX") would always be greater than 0 if the character had the ability at all (as opposed to the ability simply being ready for use). Guess I overthought the issue. Thanks for the clarification.

Second-
MQ is case sensitive

Been wondering about that one so I've tried it a couple ways. Never seemed to make a difference but I'm glad to get the definitive statement on it. Thanks again.


Finally -
why aren't you using /doevents timer to handle the timers

hehe ... couple of reasons I guess -
1) I didn't know you could use /doevents timer specifically (told ya I'm a newb) and have been a little confused on where exactly in the various subs it should be located
2) In Genbot itself it has a /doevents statement so the events seem to be getting called anyway (I've put /call Chatout statements in various locations to test and always get the messages correctly).

Although the #include statement being in the sub appears to be working, I'll try it both ways again to see if it solves the issue at hand (perhaps with a few more debugs). I'm trying to keep the genbot code as clean as possible to more easily add and edit my own changes.

I'd like to thank you again for the effort you've put into reviewing this. I sat in front of everything a few more hours today to try a couple things out and attempt to clean up the code. I'll test again this evening.

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Tue Apr 20, 2004 4:34 pm

1) I didn't know you could use /doevents timer specifically (told ya I'm a newb) and have been a little confused on where exactly in the various subs it should be located
2) In Genbot itself it has a /doevents statement so the events seem to be getting called anyway (I've put /call Chatout statements in various locations to test and always get the messages correctly).
Place it whereever you want MQ2 to check, and run, any events that have triggered. This includes chat, timers, and tells. The manual explains the different /doevents statements fairly well. The most common place for a /doevents command is right where genbot has it, in the main loop of the program.
I sat in front of everything a few more hours today to try a couple things out and attempt to clean up the code. I'll test again this evening
Keep at it, just don't lean too heavely on what you are learning with the $Param structure. Lax plans on removing that system completely here soon. The new Top Level Object structure looks duanting at first but is really quite simple to work with.

newb-n-training
a lesser mummy
a lesser mummy
Posts: 39
Joined: Mon Apr 19, 2004 8:51 pm

Post by newb-n-training » Tue Apr 20, 2004 4:42 pm

just don't lean too heavely on what you are learning with the $Param structure. Lax plans on removing that system completely here soon
hehe ... yeah, I've already started trying to convert the changes I've made which ARE working over to the new structure. It's confusing still but slowly making sense. Just figured it'd be worth it to verify where this problem lies instead of just giving it up and going for the new structure.

-- still pluggin away