How can I write string 6 - string 20 is the same? Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Clemens375
Posts: 104
Joined: 11 May 2020, 11:54

How can I write string 6 - string 20 is the same?

07 Aug 2020, 07:59

Hello,
How can I write string 6 - string 20 is the same?

Code: Select all

:T:bee2::
;~ Click
;~ Send {space} 
Soundplay, C:\Users\Admin\Desktop\GAME2\3 SOUNDS\1 493753__dj997__coins.wav
Random, Var,1,20
send, % string%Var% 


string1 = Ich brauche keine Beeren{!}

string2 = Ich gebe dir für 20 Beeren 2 Silber Münze{!}
string3 = Ich gebe dir für 20 Beeren 3 Silber Münze{!}
string4 = Ich gebe dir für 20 Beeren 1 Silber Münze{!}
string5 = Ich gebe dir für 20 Beeren 1 Silber Münze{!}
string6 = Ich gebe dir für 20 Beeren 2 Silber Münze{!}
return
Clemens375
Posts: 104
Joined: 11 May 2020, 11:54

Re: How can I write string 6 - string 20 is the same?

07 Aug 2020, 08:48

@Chunjee

I want for string 6,string 7,...,string 19, string 20 it all sends the same.

Thank you!
User avatar
boiler
Posts: 5919
Joined: 21 Dec 2014, 02:44

Re: How can I write string 6 - string 20 is the same?  Topic is solved

07 Aug 2020, 16:23

Code: Select all

string1 := "Ich brauche keine Beeren{!}"
string2 := "Ich gebe dir für 20 Beeren 2 Silber Münze{!}"
string3 := "Ich gebe dir für 20 Beeren 3 Silber Münze{!}"
string4 := "Ich gebe dir für 20 Beeren 1 Silber Münze{!}"
string5 := "Ich gebe dir für 20 Beeren 1 Silber Münze{!}"
loop, 15 {
	Index := A_Index + 5
	string%Index% := "Ich gebe dir für 20 Beeren 2 Silber Münze{!}"
}
return

:T:bee2::
;~ Click
;~ Send {space} 
Soundplay, C:\Users\Admin\Desktop\GAME2\3 SOUNDS\1 493753__dj997__coins.wav
Random, Var,1,20
send, % string%Var%
return
And note (as I mentioned in the other thread) that the string definitions need to be made up front, not below the hotstring, and not within the hotstring -- at least not below the part that actually makes use of them.

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], mikeyww and 50 guests