[jawsscripts] Please help

  • From: Sébastien Joanisse <seb2314@xxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Thu, 6 Apr 2017 08:26:19 -0400

Hello,

Here's my issue. I am trying to use scripts, but I can't compile them.
The thing is, these scripts were working 100% with jaws 15, however
using jaws 16 and above I get the following error message: The word
macro must be followed by a macro name
I was okay using JAWS 15, but now it's impossible since I'm on windows
10. Here are the scripts:

use "HotSpotClicker.jsb"
Include "HJConst.jsh"

globals
        int kpkTaskID,
        string kpkDealt,
        string kpkDealFlop,
        string kpkDealTurn,
        string kpkDealRiver

String Function kpkExtractItem (string sText, string itemName)
var
        string sItem,
        string sResult,
        int i,
        int j

Let i = StringContains (sText, itemName)
if (i > 0) then
        ; item found
        Let sText = StringChopLeft (sText, i + stringLength (sItem))
        Let i = StringContains (sText, "(")
        Let j = StringContains (sText, ")")
        Let sResult = Substring (sText, i+1, (j-i)-1)
        return (sResult)
endif
; otherwise, item not found
return ("")
EndFunction

Script kpkMonitorWindow ()
var
        string sText,
        handle h,
        string sResult,
        int i

Let kpkTaskID = 0
Let h = getFocus()

; if (GetWindowClass(h) != "SWT_Window0, ") then
        ; not our window
;       return
; endif

Let sText = GetWindowText (h, 0)
; You have been dealt
Let sResult = kpkExtractItem (sText, "You have been dealt")
if (sResult) then
        Let kpkDealt = sResult
endif

; The flop is
Let sResult = kpkExtractItem (sText, "The flop is")
if (sResult) then
        Let kpkDealFlop = sResult
endif

;The turn is
Let sResult = kpkExtractItem (sText, "The turn is")
if (sResult) then
        Let kpkDealTurn = sResult
endif

; The river is
Let sResult = kpkExtractItem (sText, "The river is")
if (sResult) then
        Let kpkDealRiver = sResult
endif


EndScript

Script ForceUpdate ()
kpkMonitorWindow ()
EndScript

Script sayDealt ()
SayString (kpkDealt)
EndScript


Script SayFlop ()
SayString (kpkDealFlop)
EndScript

Script SayTurn ()
SayString (kpkDealTurn)
EndScript

Script sayRiver ()
SayString (kpkDealRiver)
EndScript


Void Function NewTextEvent(handle hwnd, string buffer, int nAttributes,
        int nTextColor, int nBackgroundColor, int nEcho, string  sFrameName)
; cancel the monitor if already started
if (kpkTaskID) then
        UnscheduleFunction (kpkTaskID)
endif
NewTextEvent(hwnd, buffer, nAttributes,nTextColor, nBackgroundColor,
nEcho, sFrameName)
Let kpkTaskID = ScheduleFunction ("kpkMonitorWindow", 5)
EndFunction

If I remove the script called ForceUpdate, I can compile the scripts
no problem, however I need this script to compile as well. Any help
would be greatly appreciated.
__________�

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: