Code: Select all
Let>clip=0
Let>max=10
Let>bool=>
If>{(%clip% %bool% %max%)}
Message>greater
Else
Message>smaller
EndIf
Moderators: JRL, Dorian (MJT support)
Code: Select all
Let>clip=0
Let>max=10
Let>bool=>
If>{(%clip% %bool% %max%)}
Message>greater
Else
Message>smaller
EndIf
Code: Select all
Let>clip=0
Let>max=10
Let>bool=>
Let>condition=%clip%%bool%%max%
Let>Test={condition}
If>Test=TRUE
MessageModal>greater
Else
MessageModal>smaller
EndIf
Code: Select all
Let>clip=0
Let>max=10
Let>bool=>
LabelToVar>MyLabel,somevar
IncludeFromVar>somevar
Let>bool=<
LabelToVar>MyLabel,somevar
IncludeFromVar>somevar
/*
MyLabel:
If>{(%clip% %bool% %max%)}
MessageModal>greater
Else
MessageModal>smaller
EndIf
*/
Code: Select all
DeleteFile>%Script_Dir%\BardData.scp
ExportData>BARDDATA,%Script_Dir%\BardData.scp
ExecuteFile>%Script_Dir%\BardData.scp
Wait>1
Let>LoopCount=0
Label>AcquireLoop
Wait>0.05
GetControlText>Bard Secret Message,TEdit,2,vString
GetControlText>Bard Secret Message,TEdit,1,vTopic
Add>LoopCount,1
If>LoopCount>30
MDL>Secret not found. Goodbye.
Exit>0
EndIf
If>vString=##NOSUCHWINDOW##
Goto>AcquireLoop
EndIf
If>vString=
Goto>AcquireLoop
EndIf
SetControlText>Bard Secret Message,TEdit,1,Thank you
//If you want to create your own puzzle phrases
//Set the following two lines
//Let>vString=MDL>HELLOWORLD
//Let>vTopic=First Script
Let>msg_ypos=10
//Message
//Esc Key will close the script
OnEvent>key_down,VK27,0,Quit
SRT>Quit
KillProcess>vSparky
SetControlText>Sparkler,TEdit,1,Complete
WaitWindowClosed>Sparkler
Wait>1
Exit>0
END>Quit
DeleteFile>%temp_dir%Sparkler.scp
LabelToVar>SparkleScript,vScrData
WriteLn>%temp_dir%Sparkler.scp,wres,vScrData
ExecuteFile>%temp_dir%Sparkler.scp
Wait>1
DeleteFile>%temp_dir%Sparkler.scp
GetProcessIDs>msched.exe,vProcessList
Let>vSparky=vProcessList_%vProcessList_Count%
Separate>vString,space,vWord
Let>DoTurnOverFlag=1
Let>DefinePanels=
Let>vStringLength=0
Let>UsedChars=crlf
Let>PanelCount=0
Let>kk=1
Let>qq=0
Let>Staticqq=0
Let>ww=0
Repeat>ww
Add>PanelCount,1
Add>ww,1
Let>var=vWord_%ww%
RegEx>.,var,0,Char,Char_Count,0
Label>ReWord
Add>vStringLength,%Char_Count%
If>vStringLength<21
Repeat>qq
Add>qq,1
Add>Staticqq,1
Let>vCharacter=Char_%qq%
Let>vVisible=True
GoSub>DefPanels
Until>qq=Char_Count
Let>qq=0
Add>Staticqq,1
Else
Add>kk,1
Let>vStringLength=0
Let>Staticqq=0
Goto>ReWord
EndIf
Until>ww=vWord_Count
SRT>DefPanels
Let>vLeft={55*%Staticqq%}
Let>vTop={(55*%kk%)+40}
LabelToVar>Panels,vPan
Let>DefinePanels=%DefinePanels%%vPan%
END>DefPanels
/*
Panels:
object Panel%PanelCount%: TPanel
Left = %vLeft%
Top = %vTop%
Width = 50
Height = 50
Alignment = taCenter
Color = 14120960
Font.Charset = DEFAULT_CHARSET
Font.Color = 14120960
Font.Height = -40
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
ParentBackGround = False
Caption = '%vCharacter%'
Visible = %vVisible%
end
*/
/*
DialogStart:
Dialog>Dialog1
object Dialog1: TForm
BorderIcons = [biSystemMenu]
BorderStyle = bsNone
Caption = 'Bard of Macros'
ClientHeight = 500
ClientWidth = 1210
Color = 16770244
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Position = poScreenCenter
ShowHint = True
OnTaskBar = False
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 40
Top = 340
Width = 63
Height = 13
Caption = 'Type a Character'
end
object Label2: TLabel
Left = 152
Top = 340
Width = 79
Height = 13
Caption = 'Solve the Puzzle'
end
object Label3: TLabel
Left = 136
Top = 400
Width = 32
Height = 13
Caption = ''
GlowSize = 10
end
object Edit1: TEdit
Left = 57
Top = 363
Width = 40
Height = 40
Color = 5956606
CharCase = ecUpperCase
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -24
Font.Name = 'MS Sans Serif'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 8
Visible = False
end
object Edit2: TEdit
Left = 135
Top = 363
Width = 900
Height = 21
Color = 5956606
CharCase = ecUpperCase
TabOrder = 43
end
object Panel140: TPanel
Left = 1055
Top = 363
Width = 50
Height = 30
Alignment = taCenterJustify
Caption = 'Solve'
Color = 5956606
Font.Charset = DEFAULT_CHARSET
Font.Color = clMaroon
Font.Height = -19
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentBackground = False
ParentFont = False
TabOrder = 44
end
object Panel100: TPanel
Left = 0
Top = 0
Width = 1210
Height = 40
BevelOuter = bvNone
Alignment = taLeftJustify
Caption = ' Bard of Macros'
Color = 5956606
Font.Charset = DEFAULT_CHARSET
Font.Color = clMaroon
Font.Height = -19
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentBackground = False
ParentFont = False
TabOrder = 44
object Panel120: TPanel
Left = 1170
Top = 0
Width = 40
Height = 40
Caption = 'X'
Color = clRed
Font.Charset = DEFAULT_CHARSET
Font.Color = clWhite
Font.Height = -32
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentBackground = False
ParentFont = False
TabOrder = 0
end
object Panel130: TPanel
Left = 380
Top = 0
Width = 400
Height = 40
BevelOuter = bvNone
Alignment = taCenterJustify
Caption = 'Topic - %vTopic%'
Color = 5956606
Font.Charset = DEFAULT_CHARSET
Font.Color = clMaroon
Font.Height = -19
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentBackground = False
ParentFont = False
TabOrder = 44
end
end
object Panel150: TPanel
Left = 0
Top = 460
Width = 1210
Height = 40
BevelOuter = bvNone
Alignment = taCenterJustify
Caption = ''
Color = 5956606
Font.Charset = DEFAULT_CHARSET
Font.Color = clMaroon
Font.Height = -19
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentBackground = False
ParentFont = False
TabOrder = 0
end
object Panel160: TPanel
Left = 0
Top = 40
Width = 20
Height = 420
BevelOuter = bvNone
Alignment = taCenterJustify
Caption = ''
Color = 5956606
Font.Charset = DEFAULT_CHARSET
Font.Color = clMaroon
Font.Height = -19
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentBackground = False
ParentFont = False
TabOrder = 0
end
object Panel170: TPanel
Left = 1190
Top = 40
Width = 20
Height = 420
BevelOuter = bvNone
Alignment = taCenterJustify
Caption = ''
Color = 5956606
Font.Charset = DEFAULT_CHARSET
Font.Color = clMaroon
Font.Height = -19
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentBackground = False
ParentFont = False
TabOrder = 0
end
object MSButton1: tMSButton
Left = 100
Top = 400
Width = 0
Height = 0
Default = True
end
*/
/*
DialogEnd:
end
EndDialog>Dialog1
*/
LabelToVar>DialogStart,DefineDialog
LabelToVar>DialogEnd,EndDialog
Let>DialogVar=%DefineDialog%%DefinePanels%%EndDialog%
//IncludeFromVar>
IncludeFromVar>DialogVar
AddDialogHandler>Dialog1,Edit1,OnChange,TurnOver
AddDialogHandler>Dialog1,,OnClose,Quit
AddDialogHandler>Dialog1,Panel120,OnClick,Quit
AddDialogHandler>Dialog1,Panel140,OnClick,Solve
AddDialogHandler>Dialog1,MSButton1,OnClick,Solve
SetDialogProperty>Dialog1,Panel150,Caption,Type a character. See if there's a match. When you think you know the answer, type it into the solution field and pick the "Solve" button.
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
Show>Dialog1
WaitWindowOpen>Sparkler
Wait>2
SetDialogProperty>Dialog1,Edit1,Visible,True
SetFocus>Bard of Macros
SetDialogObjectFocus>Dialog1,Edit1
Label>IdleLoop
Wait>0.01
Goto>IdleLoop
SRT>Solve
GetDialogProperty>Dialog1,Edit2,Text,vSolution
If>%VString%=%vSolution%
//Message>Solved!
Let>Solved_Count=0
WriteLn>%temp_Dir%BardSolved.txt,wres,x
SetDialogProperty>Dialog1,Edit1,Visible,False
SetDialogProperty>Dialog1,Edit2,Visible,False
SetDialogProperty>Dialog1,Label1,Visible,False
SetDialogProperty>Dialog1,Label2,Visible,False
SetDialogProperty>Dialog1,Label3,Visible,False
SetDialogProperty>Dialog1,Panel140,Visible,False
Label>Yippie
Add>Solved_Count,1
If>Solved_Count=6
SetDialogProperty>Dialog1,Panel150,Caption,Congratulations on your solution!!!
Wait>2
SetDialogProperty>Dialog1,Panel150,Caption,See you next time!!!
Wait>2
SetDialogProperty>Dialog1,Panel150,Caption,Goodbye
Wait>1
GoSub>Quit
EndIf
SetDialogProperty>Dialog1,Panel150,Top,410
SetDialogProperty>Dialog1,Panel150,Height,90
SetDialogObjectFont>Dialog1,Panel150,Arial,40,1,128
SetDialogProperty>Dialog1,Panel150,Caption,WOOHOO!!! You have Solved the puzzle!!!
Let>YY=0
Repeat>yy
Wait>0.01
Add>yy,1
SetDialogObjectFont>Dialog1,Panel%yy%,Arial,40,1,16777215
Until>yy=80
Wait>1
Let>zz=0
Repeat>zz
Wait>0.01
Add>zz,1
SetDialogObjectFont>Dialog1,Panel%zz%,Arial,40,1,14120960
Until>zz=80
SetDialogProperty>Dialog1,Panel150,Caption,!!!!!!! Yippie !!!!!!!
Wait>1
SetDialogProperty>Dialog1,Panel150,Caption,!!! HOOT !!! HOOT !!! HOOT !!!
Wait>1
Goto>Yippie
Else
SetDialogProperty>Dialog1,Panel150,Caption,Sorry... That solution is incorrect...
EndIf
END>Solve
SRT>TurnOver
If>DoTurnOverFlag=1
Let>DoTurnOverFlag=0
GetDialogProperty>Dialog1,Edit1,Text,vChoice
SetDialogProperty>Dialog1,Edit1,Enabled,False
Separate>vString,vChoice,vQty
Sub>vQty_Count,1
Separate>UsedChars,vChoice,vUsed
If>vUsed_Count>1
SetDialogProperty>Dialog1,Panel150,Caption,The character %vChoice% has already been chosen.
Goto>TurnOverEnd
EndIf
Let>UsedChars=%UsedChars%%vChoice%%crlf%
If>vQty_Count=1
SetDialogProperty>Dialog1,Panel150,Caption,There is 1 %vChoice% in the puzzle.
Else
SetDialogProperty>Dialog1,Panel150,Caption,There are %vQty_Count% %vChoice%s in the puzzle.
EndIf
Let>FF=0
Repeat>FF
Add>FF,1
GetDialogProperty>Dialog1,Panel%FF%,Caption,vLetter
If>%vLetter%=%vChoice%
GetDialogProperty>Dialog1,Panel%FF%,Left,vLeft
GetDialogProperty>Dialog1,Panel%FF%,Top,vTop
GetDialogProperty>Dialog1,,Left,vDiaLeft
GetDialogProperty>Dialog1,,Top,vDiaTop
Let>Dia1X={%vDiaLeft%+%vLeft%}
Let>Dia1Y={%vDiaTop%+%vTop%}
SetControlText>Sparkler,TEdit,1,%Dia1X%;%Dia1Y%
SetFocus>Sparkler
Wait>1
SetDialogObjectFont>Dialog1,Panel%FF%,Arial,40,1,16777215
SetControlText>Sparkler,TEdit,1,-1000;-1000
EndIf
SetControlText>Macro Scheduler Message,TMemo,1,%FF% %Dia1X%;%Dia1Y%%crlf%%vLetter%=%vChoice%
Let>vLetter=
Until>FF=80
Label>TurnOverEnd
Wait>1
SetDialogProperty>Dialog1,Edit1,Enabled,True
SetDialogProperty>Dialog1,Edit1,Text,
SetDialogObjectFocus>Dialog1,Edit1
SetControlText>Sparkler,TEdit,1,-1000;-1000
Let>DoTurnOverFlag=1
DeleteFile>%Script_Dir%\BardData.scp
EndIf
END>TurnOver
SRT>DefPanels0
Let>kk=1
Let>qq=0
Repeat>qq
Add>qq,1
Let>vLeft={55*%qq%}
Let>vTop={55*%kk%}
LabelToVar>Panels,vPan
Let>DefinePanels=%DefinePanels%%vPan%
Until>qq=Char_Count
END>DefPanels0
/*
SparkleScript:
Let>msg_ypos=10
//Message
Let>size=50
OnEvent>key_down,vk27,0,Quit
SRT>Quit
Exit>0
END>Quit
WaitWindowOpen>Bard of Macros*
Dialog>Dialog2
object Dialog2: TForm
BorderStyle = bsNone
Caption = 'Sparkler'
Color = 1
TransparentColor = True
TransparentColorValue = 1
object Panel1: TPanel
Left = 0
Top = 0
BevelOuter = bvNone
Caption = 'Panel1'
Color = 1
TabOrder = 0
end
object Edit1: TEdit
Text = '-1000;-1000'
Visible = False
end
end
EndDialog>Dialog2
Let>WIN_USEHANDLE=1
//MoveWindow>Dialog2.handle,-1000,-1000
Let>WIN_USEHANDLE=0
AddDialogHandler>Dialog2,,OnClose,Quit
SetDialogProperty>Dialog2,,ClientHeight,size
SetDialogProperty>Dialog2,,ClientWidth,size
SetDialogProperty>Dialog2,Panel1,Height,size
SetDialogProperty>Dialog2,Panel1,Width,size
SetDialogProperty>Dialog2,,AlphaBlend,True
SetDialogProperty>Dialog2,,AlphaBlendValue,0
Show>Dialog2
Let>halfSize={round(%size%/2)}
Let>85Per={round(%halfSize%*0.85)}
Let>15Per={round(%halfSize%*0.15)}
Let>ang2=0
Let>kk=0
SetDialogProperty>Dialog2,,AlphaBlendValue,255
Repeat>kk
IfWindowOpen>Bard of Macros*
Else
GoSub>Quit
EndIf
GetDialogProperty>Dialog2,Edit1,Text,vPos
If>%vPos%=Complete
Let>kk=-100
Goto>Done
EndIf
Separate>vPos,;,Cur
// Sub>Cur_1,%halfSize%
// Sub>Cur_2,%halfSize%
// SetControlText>Macro Scheduler Message,TMemo,1,kk
MoveWindow>Sparkler,%Cur_1%,%Cur_2%
Let>_WRITE_LOG_FILE=0
Add>kk,1
Random>85Per,res
Add>res,%15Per%
Random>50,color
Add>Color,45500
//Let>Color=16777200
Let>Color=1880830
Random>90,ang2
Let>ang2=%ang2%*4
GoSub>Angle,Dialog2,Panel1,ang2,%halfSize%,%halfSize%,%halfSize%,2,1
Random>90,ang3
Let>ang3=%ang3%*4
GoSub>Angle,Dialog2,Panel1,ang3,%halfSize%,%halfSize%,%halfSize%,4,1
Random>90,ang
Let>ang=%ang%*4
SetDialogProperty>Dialog2,Panel1,caption,space
GoSub>Angle,Dialog2,Panel1,ang,%halfSize%,%halfSize%,res,6,color
Let>_WRITE_LOG_FILE=1
Label>Done
Until>kk<0
//Angle Usage:
//GoSub>Angle,Dialog,Object,Angle(in degrees),XStart,YStart,Length,PenSize,PenColor
//Requires Drawline subroutine
SRT>Angle
Let>DegreeAngle=Angle_var_3
Let>XStart=Angle_var_4
Let>Ystart=Angle_var_5
Let>LineLength=Angle_var_6
Let>RadAngle={%DegreeAngle%*(pi/180)}
Let>XEnd={trunc((cos(%RadAngle%))*%LineLength%)}
Let>YEnd={trunc((sin(%RadAngle%))*%LineLength%)}
Let>XEnd=%XEnd%+%XStart%
Let>YEnd=%YEnd%+%YStart%
GoSub>DrawLine,%Angle_var_1%.%Angle_var_2%.Handle,Angle_var_7,Angle_var_8,XStart,YStart,XEnd,YEnd
END>Angle
SRT>DrawLine
LibFunc>user32,GetDC,HDC,%DrawLine_var_1%
LibFunc>gdi32,CreatePen,Penres,0,%DrawLine_var_2%,%DrawLine_var_3%
LibFunc>gdi32,SelectObject,SOPres,hdc,Penres
Libfunc>gdi32,MoveToEx,mtres,HDC,%DrawLine_var_4%,%DrawLine_var_5%,0
LibFunc>gdi32,LineTo,ltres,hdc,%DrawLine_var_6%,%DrawLine_var_7%
LibFunc>gdi32,DeleteObject,DOres,Penres
LibFunc>user32,ReleaseDC,RDCres,HDC_1,HDC
END>DrawLine
*/
/*
BARDDATA:
FFFE4C00650074003E007600550052004C003D00680074007400700073003A002F002F007700770077002E006D006A0074006E00650074002E0063006F006D002F0066006F00720075006D002F00760069006500770074006F007000690063002E007000680070003F0066003D003100260074003D003100340030003300260
070003D0036003100320033002300700036003100320033000D000A000D000A00480054005400500052006500710075006500730074003E007600550052004C002C002C006700650074002C002C0076005200650073000D000A00530065007000610072006100740065003E0076005200650073002C0054006F007000690063
003A003B002C00760054006F0070006900630063000D000A004C00650074003E00760054006F007000690063003D00760054006F0070006900630063005F0032000D000A000D000A00530065007000610072006100740065003E0076005200650073002C0054006500780074003A003B002C00760054006500780074000D000
A004C00650074003E00760053007400720069006E0067003D00760054006500780074005F0032000D000A004C0065006E006700740068003E00760053007400720069006E0067002C0076004C0065006E000D000A004D00690064005300740072003E00760053007400720069006E0067002C0031002C007B00250076004C00
65006E0025002D0031007D002C00760053007400720069006E0067000D000A004D00690064007300740072003E00760053007400720069006E0067002C0032002C0076004C0065006E002C00760053007400720069006E0067000D000A000D000A004400690061006C006F0067003E004400690061006C006F00670031000D0
00A006F0062006A0065006300740020004400690061006C006F00670031003A002000540046006F0072006D000D000A0020002000430061007000740069006F006E0020003D00200027004200610072006400200053006500630072006500740020004D0065007300730061006700650027000D000A00200020006F0062006A
006500630074002000450031003A002000540045006400690074000D000A002000200065006E0064000D000A00200020006F0062006A006500630074002000450032003A002000540045006400690074000D000A002000200065006E0064000D000A0065006E0064000D000A0045006E0064004400690061006C006F0067003
E004400690061006C006F00670031000D000A000D000A005300650074004400690061006C006F006700500072006F00700065007200740079003E004400690061006C006F00670031002C00450031002C0054006500780074002C00760053007400720069006E0067000D000A005300650074004400690061006C006F006700
500072006F00700065007200740079003E004400690061006C006F00670031002C00450032002C0054006500780074002C00760054006F007000690063000D000A000D000A004C006100620065006C003E004C006F006F0070000D000A002000200057006100690074003E0030002E00300031000D000A00200020004700650
074004400690061006C006F006700500072006F00700065007200740079003E004400690061006C006F00670031002C00450032002C0054006500780074002C00760052006500730070000D000A0020002000490066003E00760052006500730070003D005400680061006E006B00200079006F0075000D000A002000200020
002000570072006900740065004C006E003E0025007300630072006900700074005F0064006900720025005C0063006C006F007300650053006500630072006500740073002E006200610074002C0077007200650073002C00740069006D0065006F0075007400200033000D000A00200020002000200057007200690074006
5004C006E003E0025007300630072006900700074005F0064006900720025005C0063006C006F007300650053006500630072006500740073002E006200610074002C0077007200650073002C00640065006C002000220025007300630072006900700074005F0064006900720025005C006200610072006400640061007400
61002E0073006300700022000D000A002000200020002000570072006900740065004C006E003E0025007300630072006900700074005F0064006900720025005C0063006C006F007300650053006500630072006500740073002E006200610074002C0077007200650073002C00520045004D002000740069006D0065006F0
075007400200031000D000A002000200020002000570072006900740065004C006E003E0025007300630072006900700074005F0064006900720025005C0063006C006F007300650053006500630072006500740073002E006200610074002C0077007200650073002C00640065006C00200022002500730063007200690070
0074005F0064006900720025005C0063006C006F007300650053006500630072006500740073002E0062006100740022000D000A00200020002000200057006100690074003E0030002E0035000D000A0020002000200020004C00650074003E00520050005F0057006100690074003D0030000D000A0020002000200020004
C00650074003E00520050005F00570069006E0064006F0077006D006F00640065003D0030000D000A002000200020002000520075006E00500072006F006700720061006D003E0025007300630072006900700074005F0064006900720025005C0063006C006F007300650053006500630072006500740073002E0062006100
74000D000A00200020002000200045007800690074003E0030000D000A002000200045006E006400490066000D000A0047006F0074006F003E004C006F006F0070000D000A000D000A000D000A000D000A000D000A000D000A000D000A00
*/