Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Timers or Loops, What's your poison of choice?


  • Please log in to reply
7 replies to this topic
Grendahl
  • Members
  • 416 posts
  • Last active: Jul 07 2014 08:01 PM
  • Joined: 10 Aug 2009
As a matter of background, I've programmed a bot for nearly every game I've played. Some have been simple skill repeaters, while others have been full blown "do it all" bots.

My question to the rest of the community here who enjoy botting games is what's your preference, subroutines or timers?

I.E.
While a trigger is ON - run a bunch of timers that set flags, each operating independantly, but only taking specific actions if the appropriate flags from other timers are ON.

OR
While a trigger is ON - run a list of repeated subroutines in a loop.

What's your thoughts?
Always have your scripts when you need them with Dropbox.
Sign up for free! http://db.tt/9Hrieqj

FrostByte
  • Members
  • 148 posts
  • Last active: Sep 16 2015 05:56 PM
  • Joined: 08 Nov 2012
I would do your second example. It seems more simple. But if you want to program more, then I'd complete the first one, because it seems more complicated (or fun, actually).

----FrostByte

FrostByte and the Artemis Asylrum® Corporation
View my projects: Artemis Media Player

FrostByte62.com is down. I'll find another place to host my stuff soon...after I get done procrastinating some more. :)


Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
Your subject title does not match the contents of your post.

It should have been "timers or loops ?"

A timer is nothing more than a metronome, that calls a subroutine at a specified time interval.

The other 'object you describe is a loop, again calling one or more subroutines.

Grendahl
  • Members
  • 416 posts
  • Last active: Jul 07 2014 08:01 PM
  • Joined: 10 Aug 2009
Leef_me, thanks for the correction.

What's your thought on the matter though? A toggled set of timers, or a toggled loop?

I'm about 75% done on a timer version. What should I keep in mind to ensure it runs most efficiently? (what parameters should i set)
Always have your scripts when you need them with Dropbox.
Sign up for free! http://db.tt/9Hrieqj

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
I don't use AHk to play games.

Generally speaking,
if the actions I need are cyclic use timers.
if the same list od actions are requires repeatedly, use loops

The docs suggest Timer subroutine shoudl be short in length.

The problem with loops is that if something happens asynchronously to the loop flow,
you can't do anything about it until it is that 'actions' turn to be done.

Grendahl
  • Members
  • 416 posts
  • Last active: Jul 07 2014 08:01 PM
  • Joined: 10 Aug 2009
OK.

All my timers are indeed short in length, and around eight of them are "on" at the same time.

What parameters should I set in the script to ensure they run best? i.e. #MaxThreads = ??
Always have your scripts when you need them with Dropbox.
Sign up for free! http://db.tt/9Hrieqj

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
dunno

Spawnova
  • Members
  • 279 posts
  • Last active: Dec 22 2015 03:07 AM
  • Joined: 29 Jun 2011
I also do alot of botting for mmo flash games and i find loops to be the best, i only use timers for statistics like runtime.