Page 1 of 2

Loop something a certain amount of times?

Posted: Mon Nov 21, 2005 12:30 pm
by DrmChld
I am looking to make a loop that will summon 10 times or so. Instead of me just cutting and pasting 10 lines I was looking for the code.

I remember vaguely that I need to do something with a For statement and a counter, god its been so long since I have done any C, and not finding anything good with Search.


Can someone post a snipplet real quick on how to do a repeat of something a certain amount of times.

Thanks

Posted: Mon Nov 21, 2005 12:35 pm
by A_Druid_00

Code: Select all

/declare i int local
/for i 1 to ${SomeInteger}
/if (${Variable${i}}==SomeValue) /dosomestuff
/next i
/return

Posted: Mon Nov 21, 2005 12:41 pm
by DrmChld
Thanks..

Can you elaborate on this line? :)


/if (${Variable${i}}==SomeValue)

He is what I have so far..But having a problem with the above line. I'm macroly-challenged

TIA

Code: Select all

Sub Main

/declare i int local 


/for i 1 to 10
/if (${Variable${i}}==10){ 
	/keypress ALT+9
	/delay 7s
	/autoinventory
}

/next i 


/return

Posted: Mon Nov 21, 2005 1:14 pm
by blueninja
DrmChld wrote:Thanks..

Can you elaborate on this line? :)


/if (${Variable${i}}==SomeValue)
That was just an example of how to do some kind of test. You don't need it, remove that line and the curly brackets. And change that /keypress crap to /cast or better yet, use spell_routines.inc to make it catch fizzles and stuff.

Posted: Mon Nov 21, 2005 1:48 pm
by notadruid
The if is not needed. You would want this:

Code: Select all

Sub Main

/declare i int local 


/for i 1 to 10
  /keypress ALT+9
  /delay 7s
  /autoinventory
/next i

/return
I assume you're summoning stuff / imbuing gems?

Re: Loop something a certain amount of times?

Posted: Wed Jun 25, 2025 1:12 am
by xyilla

Re: Loop something a certain amount of times?

Posted: Wed Jun 25, 2025 1:13 am
by xyilla

Re: Loop something a certain amount of times?

Posted: Wed Jun 25, 2025 1:14 am
by xyilla

Re: Loop something a certain amount of times?

Posted: Wed Jun 25, 2025 1:15 am
by xyilla

Re: Loop something a certain amount of times?

Posted: Wed Jun 25, 2025 1:17 am
by xyilla

Re: Loop something a certain amount of times?

Posted: Wed Jun 25, 2025 1:18 am
by xyilla

Re: Loop something a certain amount of times?

Posted: Wed Jun 25, 2025 1:19 am
by xyilla

Re: Loop something a certain amount of times?

Posted: Wed Jun 25, 2025 1:20 am
by xyilla

Re: Loop something a certain amount of times?

Posted: Wed Jun 25, 2025 1:21 am
by xyilla

Re: Loop something a certain amount of times?

Posted: Wed Jun 25, 2025 1:22 am
by xyilla