change timeouts if a player is on screen

Moderator: Moderators

Message
Author
Scarya
Moderators
Moderators
Posts: 136
Joined: 26 May 2008, 12:25
Noob?: No

change timeouts if a player is on screen

#1 Post by Scarya »

Hi,

I wrote this macro to change my timeouts if another player is on the screen so he don't think "omfg, he can loot damn fast!!111".
Well, I hope this works correctly. I tested it a bit but you never know.
If you have improvements, just tell here.

Code: Select all

automacro changeTimeouts	{
	hook player_exist
	run-once 1	
	overrideAI 1

	call {
		$playerCount = 1
		
		log Now increase the timeouts!
		
		do timeout ai_items_take_start 1.5
		do timeout ai_items_take_end 2.5
		do timeout ai_teleport_idle 3
		do timeout ai_attack_waitAfterKill 0.7

		while ($playerCount != 0) as wait
			#log loop me up Scotty!
			#pause 20 # stop doing anything
			$playerCount = 0
			do eval foreach my $_player (@{$::playersList->getItems()}) { $::Macro::Data::varStack{playerCount} += 1;}
		end wait

		log Now decrease the timeouts!

		do timeout ai_items_take_start 0.3
		do timeout ai_items_take_end 1.5
		do timeout ai_teleport_idle 0.5
		do timeout ai_attack_waitAfterKill 0.3

		release changeTimeouts
	}
}
Edit the values to your needs and excuse my bad English.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the universe trying to produce bigger and better idiots.
So far, the universe is winning.

Richard Cook

Wiki

Apple kore
Noob
Noob
Posts: 4
Joined: 19 Sep 2009, 22:01
Noob?: No
Location: Inside an apple seed covering.

Re: change timeouts if a player is on screen

#2 Post by Apple kore »

Hey Scarya!

Thank you for sharing your macro. I've been trying to configure it so that it will work but the only problem is that the bot cannot detect if there are players in the screen. It can hook the player_exist while loading up the console but once a player appears in the screen it still attacks at 0.1 and not the specified timeout after a playercount=1.

Heres what I put in my macro.txt:

Code: Select all

automacro changeTimeouts   {
   hook player_exist
   run-once 1   
   overrideAI 1

   call {
      $playerCount = 1
      
      log Now increase the timeouts!
      
      do timeout ai_teleport_idle 3
      do timeout ai_attack_waitAfterKill 1

      while ($playerCount != 0) as wait
         #log loop me up Scotty!
         #pause 20 # stop doing anything
         $playerCount = 0
         do eval foreach my $_player (@{$::playersList->getItems()}) { $::Macro::Data::varStack{playerCount} += 1;}
      end wait

      log Now decrease the timeouts!

      do timeout ai_teleport_idle 0.5
      do timeout ai_attack_waitAfterKill 0.1

      release changeTimeouts
   }
}
PS: Do you know how to change it so that the timeout for waitafterkill will be random for each monster?
For example, ai_attack_waitAfterKill @random 0.7-1.2.

It'll make the bot more natural :P
Thanks!

<3 Apple kore
Image

Post Reply