Search found 444 matches
- 12 Apr 2018, 09:01
- Forum: Ask For Help
- Topic: Ughm help
- Replies: 17
- Views: 2866
Re: Ughm help
Edit; nvm
- 12 Apr 2018, 08:51
- Forum: Ask For Help
- Topic: Why does the following variable name containt illegal character?
- Replies: 6
- Views: 1223
Why does the following variable name containt illegal character?
error.png As you can see in the picture. Why the heck is it invalid? All the characters are letters. name := value %name% := score I want the value of a variable to be a separate variable. I thought it was because there could be blank spaces but I added StringReplace , name, name, %A_Space%,,All St...
- 12 Apr 2018, 07:54
- Forum: Ask For Help
- Topic: If-expression works even without parentheses, i.e. ( )
- Replies: 13
- Views: 1915
Re: Quite simple question about IF
but var1 is a variable.john_c wrote:Yes, but since there is no ( after if, this if should not be parsed as expression and so, it should not work!Odlanir wrote:the result is if true && true
if variable = if variable is false
Try
Code: Select all
var1 := "foo"
var2 := "bar"
if var1 = "foo" && var2 = "bar"
msgBox % "Success"
- 12 Apr 2018, 07:40
- Forum: Ask For Help
- Topic: If-expression works even without parentheses, i.e. ( )
- Replies: 13
- Views: 1915
Re: Quite simple question about IF
If only applies to var1. But the && makes var2 part of the condition.
- 12 Apr 2018, 03:31
- Forum: Ask For Help
- Topic: Ughm help
- Replies: 17
- Views: 2866
Re: Ughm help
Like this? for index, person in People { name := person.name %name% := 1 } When I do this it says %name% contains invalid character. But the Names only are letters and occasionally numbers. Is it because it has blankspace? I'm using this script TestTexti = ( Name1 Status - (10/10) Name2 Status - (4...
- 12 Apr 2018, 03:22
- Forum: Ask For Help
- Topic: Ughm help
- Replies: 17
- Views: 2866
Re: Ughm help
no, dont do this endless-variable-creation stuff just define another property person.isRegistered := false Ughm I don't understand. I need to write the people who are pending on a separate .txt So here's the people's information that I did get: TestTexti = ( Name1 Status - (10/10) Name2 Status - (4...
- 11 Apr 2018, 13:06
- Forum: Ask For Help
- Topic: Ughm help
- Replies: 17
- Views: 2866
Re: Ughm help
great, then just create another property TestTexti = ( Name1 Status - (10/10) Name2 Status - (4/10) Name3 Status - (6/10) ) splitArray := StrSplit(TestTexti, "`n") People := {} Loop, % splitArray.MaxIndex() { if (Mod(A_Index, 2) == 0) { continue } person := {} person.name := splitArray[A_Index] per...
- 11 Apr 2018, 12:18
- Forum: Ask For Help
- Topic: Ughm help
- Replies: 17
- Views: 2866
Re: Ughm help
presumably you actually only want to extract a status' number and not the entirety of "Status - (6/10)", so why not do just that in the same step youre initializing your collection of people TestTexti = ( Name1 Status - (10/10) Name2 Status - (4/10) Name3 Status - (6/10) ) splitArray := StrSplit(Te...
- 11 Apr 2018, 11:25
- Forum: Ask For Help
- Topic: Ughm help
- Replies: 17
- Views: 2866
Re: Ughm help
Nothing wrong with the original function. The replacement I suggested isn't well documented and it helps to have a little knowledge in other languages to dig it up. If you need (relatively) simple explanations on anything I suggested, feel free to ask. How do I get Name1 when I want it? And Status1...
- 11 Apr 2018, 11:06
- Forum: Ask For Help
- Topic: Ughm help
- Replies: 17
- Views: 2866
Re: Ughm help
On your full code: 1) Why are you splitting the string twice? 2) You can simplify your code with a call to Object() . See comments below. TestTexti = ( Name1 Status - (10/10) Name2 Status - (4/10) Name3 Status - (6/10) ) ; This line is unnecessary ; Array := StrSplit(TestTexti, "`n") splitArray := ...
- 11 Apr 2018, 10:50
- Forum: Gaming
- Topic: Key press getting stuck Topic is solved
- Replies: 14
- Views: 3218
Re: Key press getting stuck Topic is solved
No, what the value for SetTimer means is "This is how long should elapse between the START of each run". So a value of 100 means "Run this code every 100ms". A value of 0 is special. It means "Run this code as soon as the current thread finishes". However, let's ignore that for the moment and behav...
- 11 Apr 2018, 08:23
- Forum: Gaming
- Topic: Key press getting stuck Topic is solved
- Replies: 14
- Views: 3218
Re: Key press getting stuck Topic is solved
Hmm, well if you run a Timer at 0 frequency (Which is dumb in the extreme) then yes, it will have an effect. However, if you use a timer *properly* and set the timer tick-rate to be the rate at which you want to fire the code, then sleeping at the end of a timer fire is pointless. In the below code...
- 11 Apr 2018, 08:13
- Forum: Gaming
- Topic: Cursor movements get no stuck
- Replies: 6
- Views: 1504
Re: Cursor movements get no stuck
Trying to do this with MouseGetPos is pretty pointless if you want to read raw mouse input. Sure you can keep moving the cursor to the middle of the screen, but why bother trying to make an absolute input method behave like a relative one, when there is a perfectly good way to read relative mouse m...
- 11 Apr 2018, 07:50
- Forum: Ask For Help
- Topic: Ughm help
- Replies: 17
- Views: 2866
Ughm help
Can somebody help me fix this please? I donno why it's not working! Loop % People.MaxIndex() { RegExMatch(People[A_Index].Status, "\(\d+/", People[A_Index].Value) StringTrimLeft, People[A_Index].Value, People[A_Index].Value, 1 StringTrimLeft, People[A_Index].Value, People[A_Index].Value, 1 } ^^ code...
- 10 Apr 2018, 13:28
- Forum: Ask For Help
- Topic: Split lines into separate strings using stringsplit `n?
- Replies: 21
- Views: 3006
Re: Split lines into separate strings using stringsplit `n?
trust me you really dont need a loop to do what you just described. if you have a piece of code that absolutely requires you to do it anyway, then you need to take a good look at that particular piece of code heres how youd do it for demonstration, but dont do it #NoEnv #WinActivateForce #SingleIns...
- 10 Apr 2018, 12:55
- Forum: Ask For Help
- Topic: Split lines into separate strings using stringsplit `n?
- Replies: 21
- Views: 3006
Re: Split lines into separate strings using stringsplit `n?
maybe something like this? TestText = (Ltrim Jane Single Mark Single Peter Married Susan Single John Married ) splitArray := StrSplit(TestText, "`n") People := {} Loop, % splitArray.MaxIndex() { if (Mod(A_Index, 2) == 0) { continue } person := {} person.firstName := splitArray[A_Index] person.statu...
- 10 Apr 2018, 12:23
- Forum: Ask For Help
- Topic: Split lines into separate strings using stringsplit `n?
- Replies: 21
- Views: 3006
Re: Split lines into separate strings using stringsplit `n?
Warning! This works only if you don't have duplicate names ( keys ) in your string. str = ( Name1 Status1 Name2 Status2 Name3 Status3 ) Arr := StrSplit(str,"`n"), NewArr := Object() loop, % Arr.MaxIndex() { i := a_index if ( mod(i,2) = 1) NewArr[Arr[i]] := Arr[i+1] } for i,v in NewArr MsgBox % i "`...
- 10 Apr 2018, 11:52
- Forum: Ask For Help
- Topic: Split lines into separate strings using stringsplit `n?
- Replies: 21
- Views: 3006
Re: Split lines into separate strings using stringsplit `n?
i think youre better off explaining the more general issue youre facing and not try to bully code into submission name/status hints at associative arrays, rather than an abominable amalgamation of pseudo arrays and double derefs I have a script that will go to a page and OCR and append the informat...
- 10 Apr 2018, 11:36
- Forum: Ask For Help
- Topic: Split lines into separate strings using stringsplit `n?
- Replies: 21
- Views: 3006
Re: Split lines into separate strings using stringsplit `n?
Array := StrSplit(TestText, "`n") a:= 1 Loop % Array.MaxIndex() { % Array%a% % := % "Array"a+1 % a := a+2 } return So suppose there are four Arrays, Array.1, Array.2, Array.3, Array.4 I want the value of Array.1, say James, to be set as a variable. James := "". Now I want James := Value of Array2. ...
- 10 Apr 2018, 09:53
- Forum: Ask For Help
- Topic: Split lines into separate strings using stringsplit `n?
- Replies: 21
- Views: 3006
Re: Split lines into separate strings using stringsplit `n?
You can do this: Lol := "PersonName" %Lol% := "Attribute" Msgbox % Lol Msgbox % PersonName Oh forgot the "" lol. Thanks. Can you help me fix this? Array := StrSplit(TestText, "`n") a:= 1 Loop % Array.MaxIndex() { % Array%a% % := % "Array"a+1 % a := a+2 } return So let me explain. Array1 represents ...