|
You last visited: Today at 04:36
Advertisement
[AutoIT] Subscript used on non-accessible variable.
Discussion on [AutoIT] Subscript used on non-accessible variable. within the AutoIt forum part of the Coders Den category.
02/19/2020, 01:59
|
#1
|
elite*gold: 110
Join Date: May 2010
Posts: 487
Received Thanks: 214
|
[AutoIT] Subscript used on non-accessible variable.
Hi,
I have a problem :/
Here is my code:
Code:
#RequireAdmin
#include "KDMemory.au3"
Const $processName = "s4c.exe", $moduleName = $processName
Const $baseOffset = 0x017293C0
Const $offsets[7] = [0x684, 0xF4, 0xE0, 0x3C, 0x0, 0x17C, 0xFC]
$processId = ProcessExists($processName)
$handles = _KDMemory_OpenProcess($processId)
$baseAddress = _KDMemory_GetModuleBaseAddress($handles, $moduleName) + $baseOffset
$memoryData = _KDMemory_ReadProcessMemory($handles, $baseAddress, "FLOAT", $offsets)
MsgBox(64, 'Result', 'Value: ' & $memoryData[1])
_KDMemory_CloseHandles($handles)
I receive this error after running the code: Subscript used on non-accessible variable.
|
|
|
02/19/2020, 04:09
|
#2
|
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
|
Quote:
Originally Posted by b0sted
Hi,
I have a problem :/
Here is my code:
Code:
#RequireAdmin
#include "KDMemory.au3"
Const $processName = "s4c.exe", $moduleName = $processName
Const $baseOffset = 0x017293C0
Const $offsets[7] = [0x684, 0xF4, 0xE0, 0x3C, 0x0, 0x17C, 0xFC]
$processId = ProcessExists($processName)
$handles = _KDMemory_OpenProcess($processId)
$baseAddress = _KDMemory_GetModuleBaseAddress($handles, $moduleName) + $baseOffset
$memoryData = _KDMemory_ReadProcessMemory($handles, $baseAddress, "FLOAT", $offsets)
MsgBox(64, 'Result', 'Value: ' & $memoryData[1])
_KDMemory_CloseHandles($handles)
I receive this error after running the code: Subscript used on non-accessible variable.
|
$memoryData isn't assigned with an array because some error is happening, so you need to see whats wrong first, you can log the error code with @error, maybe your offsets are wrong, it may happen if you forgot to reverse the order that you get in cheat engine.
Const $offsets[7] = [0xFC,0x17C,0x0,0x3C,0xE0,0xF4,0x684]
|
|
|
02/19/2020, 13:28
|
#3
|
elite*gold: 110
Join Date: May 2010
Posts: 487
Received Thanks: 214
|
Quote:
Originally Posted by elmarcia
$memoryData isn't assigned with an array because some error is happening, so you need to see whats wrong first, you can log the error code with @error, maybe your offsets are wrong, it may happen if you forgot to reverse the order that you get in cheat engine.
Const $offsets[7] = [0xFC,0x17C,0x0,0x3C,0xE0,0xF4,0x684]
|
I changed the order of the offsets, but its still not working.
I added an error-if, my code looks like this now:
Code:
#RequireAdmin
#include "KDMemory.au3"
Const $processName = "S4Client.exe", $moduleName = $processName
Const $baseOffset = 0x017293C0
Const $offsets[7] = [0xFC,0x17C,0x0,0x3C,0xE0,0xF4,0x684]
$processId = ProcessExists($processName)
$handles = _KDMemory_OpenProcess($processId)
$baseAddress = _KDMemory_GetModuleBaseAddress($handles, $moduleName) + $baseOffset
$memoryData = _KDMemory_ReadProcessMemory($handles, $baseAddress, "FLOAT", $offsets)
if(@error) Then
MsgBox(48, "Error", "Can't read memory!" & @CRLF & "@error: " & @error & ", @extended: " & @extended)
Else
MsgBox(64, 'Result', 'Value: ' & $memoryData[0])
_KDMemory_CloseHandles($handles)
EndIf
And my Cheat Engine Entry looks like this:
This is the error-code now:
|
|
|
02/20/2020, 16:11
|
#4
|
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
|
Quote:
Originally Posted by b0sted
I changed the order of the offsets, but its still not working.
I added an error-if, my code looks like this now:
Code:
#RequireAdmin
#include "KDMemory.au3"
Const $processName = "S4Client.exe", $moduleName = $processName
Const $baseOffset = 0x017293C0
Const $offsets[7] = [0xFC,0x17C,0x0,0x3C,0xE0,0xF4,0x684]
$processId = ProcessExists($processName)
$handles = _KDMemory_OpenProcess($processId)
$baseAddress = _KDMemory_GetModuleBaseAddress($handles, $moduleName) + $baseOffset
$memoryData = _KDMemory_ReadProcessMemory($handles, $baseAddress, "FLOAT", $offsets)
if(@error) Then
MsgBox(48, "Error", "Can't read memory!" & @CRLF & "@error: " & @error & ", @extended: " & @extended)
Else
MsgBox(64, 'Result', 'Value: ' & $memoryData[0])
_KDMemory_CloseHandles($handles)
EndIf
And my Cheat Engine Entry looks like this:
This is the error-code now:

|
It should work, check your pointer path to see if its working.
Check individual addresses to see if they point to where they should.
Check your base address.
Ex:
Code:
$res = _KDMemory_ReadProcessMemory($handles,$baseAddress,"int")
;Should be *147142408 -> 8C53708 (from cheat engine window bottom address)
msgbox(0,"base address points to",$res[0])
$next_addr = $res[0]
for $i = 0 to ubound($offsets) - 1
$next = _KDMemory_ReadProcessMemory($handles,$next_addr + $offsets[$i],"int")
msgbox(0,"next address points to","0x"&hex($next[0],8))
$next_addr = $next[0]
next
|
|
|
05/17/2020, 18:29
|
#5
|
elite*gold: 50
Join Date: Jan 2017
Posts: 712
Received Thanks: 595
|
I don't recommend KDMemory, use normal Memory instead, if you don't know how just pm me or reply i'll help you when i see ur message
|
|
|
Similar Threads
|
Subscript used on non-accessible variable. Help?
11/18/2019 - AutoIt - 1 Replies
Delete please!! wrong thread.
|
Subscript used on non-accessible variable
10/08/2016 - AutoIt - 16 Replies
Hey,
habe ein kleines Problem mit meinem Code hier. Es kommt immer die Fehlermeldung Subscript used on non-accessible variable.
kann mir da einer helfen?
For $i = 1 To 4 Step 1
Switch $i
Case 1
$2coord = PixelSearch(871, 363, 997, 540, 0xCDEC82, 10, 1, $handle) ; Bereich A-B
Case 2
|
Problem error: Subscript used whit non-Array variable "
08/26/2010 - Last Chaos - 1 Replies
hey leute,
seitdem mein laptop ein windows update gemacht hat funktioniert der ultra bot nicht.
es dann kommt immer die fehlermeldung " error: Subscript used whit non-Array variable "
vor diesem update ging der bot noch.
|
All times are GMT +1. The time now is 04:37.
|
|