I need a variabel, which i cant figureing out

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Marcdk
Junior Coder
Posts: 36
Joined: Sat Sep 22, 2007 10:16 pm

I need a variabel, which i cant figureing out

Post by Marcdk » Tue Oct 02, 2007 3:46 pm

hi again ;)

Well in my bot i have some diffrent languages that u can choose from in the dialog

these languages contains diffrent keys to be pressed in a label im making

I got this:
Label>Language
If>dialog1.english
key1=e
key2=q
endif
If>dialog1.german
key1=e
key2=b
label>end
Later in my script i need the bot to press 'e' followed by a 'q' IF english is selected, as u can see if german is selected it presses: 'e' followed by a 'b' :)
-I have these languages in a combobox


Can anyone please help me with this? its probably very easy to make, but i cant figureing it out... :(

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 02, 2007 4:34 pm

Perhaps this helps:

Code: Select all

Dialog>Dialog1
   Caption=Dialog1
   Width=358
   Height=182
   Top=455
   Left=571
   Label=Choose Language:,40,40,true
   ComboBox=msComboBox1,144,32,161,English%CRLF%German%CRLF%French
   Button=OK,144,88,75,25,1
EndDialog>Dialog1

Show>Dialog1,r

If>Dialog1.msComboBox1.Itemindex=0
  //English selected 
  SetFocus>TARGET_APP_TITLE_HERE
  Send>eq
Endif

If>Dialog1.msComboBox1.Itemindex=1
  //German selected
  SetFocus>TARGET_APP_TITLE_HERE
  Send>eb
Endif

//etc
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Marcdk
Junior Coder
Posts: 36
Joined: Sat Sep 22, 2007 10:16 pm

Post by Marcdk » Tue Oct 02, 2007 5:24 pm

No sorry, this dont help me ... i have a label later in my script, that will write som text, in the game (this bot is for a game :))

I need it to say in my label that will come later in script something like:

Send>%key1%
wait>0.1
Send>%key2%


(I dont know if "%" is needed :/)

So the key1 and key2 is selected from start in the dialog, i just need to set it up someway, so i can write it like that :P

I really hope u understand :)

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 02, 2007 5:29 pm

Yes you can do:

Let>key1=a
Let>key2=f

..
..

Send>key1
Wait>0.1
Send>key2

In this case it will work with or without % symbols.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Marcdk
Junior Coder
Posts: 36
Joined: Sat Sep 22, 2007 10:16 pm

Post by Marcdk » Tue Oct 02, 2007 5:34 pm

Okay so the example i postet in the first post works? =) if it does, nice :D thx

Just with: the "let" code ofc :) i got this, it should work
Label>Language
If>dialog1.english
let>key1=e
let>key2=q
endif
If>dialog1.german
let>key1=e
let>key2=b
label>end

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 02, 2007 5:43 pm

Yes, but this doesn't look right:

If>dialog1.german

You need something like:

If>something=some_value
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Marcdk
Junior Coder
Posts: 36
Joined: Sat Sep 22, 2007 10:16 pm

Post by Marcdk » Tue Oct 02, 2007 6:12 pm

Damn, ok im stucked, it allmost worked when i tested... bwah :(

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Tue Oct 02, 2007 9:41 pm

Also don't forget that a multiline If> needs an end if

Label>Language
If>dialog1.english
let>key1=e
let>key2=q
endif
If>dialog1.german
let>key1=e
let>key2=b
endif
label>end

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts