This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
 All Forums
 Feature Updates
 Closed or Deferred Requests
 [ALIEN SCRIPT] S+ and OS Version API

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Kingron Posted - 03/03/2012 : 01:42:13
I'd like to have some API to know the OS version/platform and S+ version, so We might using some different API or logic to do something.
For example, we might do different at Windows XP and Windows Vista or Windows 7.

Also if we can provider an API for debug info output is great.
For example, we should provider an API acDebugPrint(string)
and this API invoke the system API OutputDebugString to print string.
The develop could using the DbgView to check the ouput logs.
This is useful for debug the script.
3   L A T E S T    R E P L I E S    (Newest First)
Kingron Posted - 03/03/2012 : 14:08:28
Great!

I put below script slice into Strokesplus.lua, and reload the config, it works for me:

API = alien.core
local floor = math.floor

function xor(a, b)
local r = 0
for i = 0, 31 do
local x = a / 2 + b / 2
if x ~= floor (x) then
r = r + 2^i
end
a = floor (a / 2)
b = floor (b / 2)
end
return r
end

function band(a,b)
return ((a+b) - xor(a,b))/2
end

function shl(x, by)
return x * 2 ^ by
end

function shr(x, by)
return floor(x / 2 ^ by)
end

local mb = API.load("kernel32.dll")
local GetVersion = mb.GetVersion
GetVersion:types{ ret = 'uint', abi = 'stdcall'}
local iVersion = GetVersion()
OS_MAJOR_VER = band(band(iVersion,65535),255)
OS_MINOR_VER = band(shr(band(iVersion,65535),8),255)

mb = API.load("kernel32.dll")
acDebugPrint = mb.OutputDebugStringA
acDebugPrint:types{ ret = 'void', abi = 'stdcall', 'string' }

Test action script

acSendKeys("{BEEP 1400 100}")
acDebugPrint("test debug print")
acDebugPrint(OS_MAJOR_VER)
acDebugPrint(OS_MINOR_VER)
acDebugPrint("==end==")
Rob Posted - 03/03/2012 : 10:08:28
You should be able to call OutputDebugString via Alien as well, but I haven't looked into it. Note that I'm very much an Alien novice, I just built it into S+ for folks to use instead of building new actions for every little request...don't want to reproduce the whole Windows API! =)
Rob Posted - 03/03/2012 : 09:58:20
See this topic to get OS version via Alien. You can make almost any API call via Alien, which is built into S+ =)

http://www.strokesplus.com/forum/topic.asp?TOPIC_ID=272

StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000