How to read 2 contents from 1 line?

Get help with using AutoHotkey and its commands and hotkeys
dw0rd1337
Posts: 3
Joined: 13 Sep 2020, 15:13

How to read 2 contents from 1 line?

16 Sep 2020, 09:07

Example Key from site - 12717931321286445714

Code: Select all


IfNotExist, %a_appdata%\Program Manager\winsecure$1dasea2.log
{
FileCreateDir, %a_appdata%\Program Manager
FileAppend, %var10%%var11%, %a_appdata%\Program Manager\winsecure$1dasea2.log
RegWrite, REG_SZ, HKCU, Software\systemhash, bin, %var10%%var11%
}
RegRead, KeyNum, HKCU, Software\systemhash, bin
Key1 = %KeyNum%
link := "http dw0rd.xyz /userkeys.html"  Broken Link for safety
req := ComObjCreate("WinHTTP.WinHTTPRequest.5.1")
req.Open("GET", link, false)
req.Send()
read := req.responseText
sleep 250

if read contains %Key1%
{
MsgBox, Sub Active!
return
}
else
{
MsgBox, Key not active!
}
But im need read 2 contetns from 1 line and on site many lines
Example Key - 12717931321286445714:20.09.2020

20.09.2020 - date when sub ended
Im need:

Code: Select all

IfNotExist, %a_appdata%\Program Manager\winsecure$1dasea2.log
{
FileCreateDir, %a_appdata%\Program Manager
FileAppend, %var10%%var11%, %a_appdata%\Program Manager\winsecure$1dasea2.log
RegWrite, REG_SZ, HKCU, Software\systemhash, bin, %var10%%var11%
}
RegRead, KeyNum, HKCU, Software\systemhash, bin
Key1 = %KeyNum%
link := "http dw0rd.xyz /userkeys.html"  Broken Link for safety
req := ComObjCreate("WinHTTP.WinHTTPRequest.5.1")
req.Open("GET", link, false)
req.Send()
read := req.responseText
sleep 250

if read contains %Key1%
{
FormatTime, DateStringPC, , ShortDate
;~ %DataStringKEY% = 20.09.2020 (read from site)
If (DateStringPC = DataStringKEY)
{
MsgBox, Sub Active! Sub end - %DataStringKEY%
return
}
else
{
MsgBox, Sub ended!
return
}
}
else
{
MsgBox, Key not Active!
}
User avatar
mikeyww
Posts: 263
Joined: 09 Sep 2014, 18:38

Re: How to read 2 contents from 1 line?

16 Sep 2020, 09:37

Code: Select all

line = 12717931321286445714:20.09.2020
part := StrSplit(line, ":")
MsgBox, % "Key: " . part[1] . "`nDate: " . part[2]
ExitApp
Albireo
Posts: 1231
Joined: 16 Oct 2013, 13:53

Re: How to read 2 contents from 1 line?

16 Sep 2020, 09:40

Welcome to AHK!
(I don't understand what you want help with)
Do you want to split 12717931321286445714:20.09.2020 to two parts?
Part1 .: 12717931321286445714
Part2 .: 20.09.2020
Must these then be processed?
dw0rd1337
Posts: 3
Joined: 13 Sep 2020, 15:13

Re: How to read 2 contents from 1 line?

16 Sep 2020, 10:16

Albireo wrote:
16 Sep 2020, 09:40
Welcome to AHK!
(I don't understand what you want help with)
Do you want to split 12717931321286445714:20.09.2020 to two parts?
Part1 .: 12717931321286445714
Part2 .: 20.09.2020
Must these then be processed?
Im need read key and date from site and compare key with userkey from script.
If key active, then compare key expiration date with real date.

If real date = date from site, then sub end
else
sub active

ExampleKey - 123123:20.09.2020
And each user has his own key and his own date.

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], list, mikeyww, Sneakysnail and 61 guests