<< Click to Display Table of Contents >> Navigation: 3. Script Language > PlugIn-Commands > PlugIn Commands |
MiniRobotLanguage (MRL)
Buttonbar for use with Firefox and Twitter (X)
This is great enhancement for Twitter Users.
Intention
This is Buttonbar that will attach right Side of Twitter and enable you several Options.
It uses several Tricks that show how the Buttonbar is used.
'
'SPR Script-file: New Script_1
'Purpose:
'Author: Theo Gottwald
'===========================================================
'#EXE:?path\
'#SPI:ForceWrite
'#ICS:20
AIC.Set Key|file
SDO.Set Key|file
DLT.Set Key|File
'GTO.Start
'===========================================================
' Main Script
'===========================================================
' This is the site we are going to open
VAR.$$LNK=https://twitter.com/TheoGottwald/following
VAR.$$PAR=-new-window
VAR.$$TAB=People followed
' This will locate FF and run it
' If the window is too large (1840,1644) change size in Library
VAR.$$PAX="$$LNK" $$PAR
%Firefox $$PAX
WII.10
'------------------------------------------------------------
' Buttonbar Definitions
'------------------------------------------------------------
:Start
' Sample Click
%Locate_TW
' Start the Button-Bar
PIL.$$REA|01
' Make the PlugIn visible
PIS.$$REA|hide
' Will set the number of visible Buttons to 4
PIS.$$PIN|SetButtonNumber|11
' Set Distance between buttons (vertical in Points)
PIS.$$REA|sbvd|4
' Set Distance vertical in Points, not needed here
PIS.$$REA|sbvd|4
' Plugin is horizontal
PIS.$$REA|sv
' Make the PlugIn visible
PIS.$$REA|show
' attach the Plugin to the window
PIS.$$REA|attach|$$HWN|2|X
' Set text on Button 1 to 20
PIS.$$REA|sBt|1|Dictate
PIS.$$REA|sBt|2|Rework
PIS.$$REA|sBt|3|P. Comm.
PIS.$$REA|sBt|4|N. Comm.
PIS.$$REA|sBt|5|Fun.Comm.
PIS.$$REA|sBt|6|To Rhyme
PIS.$$REA|sBt|7|To Eng.
PIS.$$REA|sBt|8|To Ger.
PIS.$$REA|sBt|9|BACK
PIS.$$REA|sBt|10|Pic S/R
PIS.$$REA|sBt|11|Ende
'------------------------------------------------------------
' Buttonbar Main-Loop
'------------------------------------------------------------
DOL.1
PIW.$$REA|$$MES
STR.Split String|$$MES|!|$$BNU|$$BME
JIV.$$BME=normal!|endloop
VBT.$$BME
SCS.$$BME
CAS.P!
GTO.weiter
CAS.R!
GTO.weiter
CAE.
GTO.endloop
ESL.
DBP.$$BME--$$JMP
JIZ.$$JMP|endloop
:weiter
' Button-Number
VBT.$$BNU
VBT.$$BME
$$GOT=DoB$$BNU
DBP.$$BME-->$$BNU
SCN.$$BNU
CAN.1,2,3,4,5,6,9,10
GSB.$$GOT
CAN.7
GSB.DoB7|EN
CAN.8
GSB.DoB7|DE
CAE.
GTO.enz
ESL.
:endloop
NEW.t
BRK.
EIF.
OOP.
:enz
END.
'-----------------------------------------------------------
' Buttonbar Subprograms for Buttons
'-----------------------------------------------------------
:DoB1
AIC.Dictate Letter|$$MYT
DBP.$$MYT
CLP.t|$$MYT
MSB.550|2
:overB1
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoB2
'PRT. Was here with: $$BME
CLP.r|$$MYT
$$KEP=$$MYT
GSB.Pro_02
$$PRO+ Text: $$MYT
AIC.Set Model Completion|0
AIC.Ask Completion|$$PRO|$$RES
CLP.t|$$RES
MSB.660|2
MSB.660|2
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoB3
CLP.r|$$MYT
$$KEP=$$MYT
GSB.Pro_01|positive Comment
$$PRO+ Text: $$MYT
AIC.Set Model Completion|0
AIC.Ask Completion|$$PRO|$$RES
CLP.t|$$RES
MSB.660|2
MSB.660|2
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoB4
CLP.r|$$MYT
$$KEP=$$MYT
GSB.Pro_01|negative Comment
$$PRO+ Text: $$MYT
AIC.Set Model Completion|0
AIC.Ask Completion|$$PRO|$$RES
CLP.t|$$RES
MSB.660|2
MSB.660|2
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoB5
CLP.r|$$MYT
$$KEP=$$MYT
GSB.Pro_03|very funny Comment
$$PRO+ Text: $$MYT
AIC.Set Model Completion|0
AIC.Ask Completion|$$PRO|$$RES
CLP.t|$$RES
MSB.660|2
MSB.660|2
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoB6
CLP.r|$$MYT
$$KEP=$$MYT
GSB.Pro_04
$$PRO+ Text: $$MYT
MSB.660|2
AIC.Set Model Chat|1
AIC.Ask Chat|$$PRO|$$RES
DBP.$$RES
CLP.t|$$RES
MSB.860|2
MSB.860|1
MSB.860|1
RET.
'-----------------------------------------------------------
' To Eng.
'-----------------------------------------------------------
:DoB7
CLP.r|$$MYT
$$INS=§§_01
DLT.Translate Text|$$MYT|$$RES||$$INS
DBP.$$RES
CLP.t|$$RES
MSB.860|2
MSB.860|1
MSB.860|1
RET.
'-----------------------------------------------------------
' To Germ.
'-----------------------------------------------------------
:DoB8
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoB9
'PRT. Was here with: $$BME
CLP.r|$$MYT
DBP.$$KEP
CLP.t|$$KEP
$$KEP=$$MYT
MSB.660|2
MSB.660|2
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoB10
IVV.$$BME=!P
ANA.From Clipboard|$$KEB
ELS.
ANA.To Clipboard|$$KEB
EIF.
RET.
'-----------------------------------------------------------
' A.I. Calls to ChatGPT etc.
'-----------------------------------------------------------
:Pro_01
$$INS=§§_01
$$PRO=Act as a Twitter-Influencer.
$$PRO+ Make a $$INS comment from the text below.
$$PRO+ Add surprising Arguments to proof our standpoint.
$$PRO+ Make the result funny and highly intelligent.
$$PRO+ Then add Linefeed and then
$$PRO+ Add space-sparated Hashtags to the end of the text.
$$PRO+ Return only the refined Twitter-Text in the same language as the Text below is.
RET.
'-----------------------------------------------------------
:Pro_02
$$PRO=Correct and refine the text.
$$PRO+ dd a Linefeed and then Add Hashtags to the end of the text.
$$PRO+ Return only the refined Twitter-Text in German.
$$PRO+ followed by a Linefeed and the Space-Separted Hashtags $crlf$
RET.
'-----------------------------------------------------------
:Pro_03
$$INS=§§_01
$$PRO=Act as a Twitter-Influencer. Read the text below and then
$$PRO+ Make a $$INS comment about the text.
$$PRO+ Analyze the Text then created a funny Joke or comment on that topic.
$$PRO+ Let it be a Joke or something suprising funny and highly intelligent.
$$PRO+ Then add Linefeed and then
$$PRO+ Add space-sparated Hashtags to the end of the text.
$$PRO+ Return only the refined Twitter-Text in the same language as the Text below is.
RET.
'-----------------------------------------------------------
:Pro_04
$$PRO=Refine the text in way that its funny and rhymes like Goethe, Schiller.
$$PRO+ keeping its sense.
$$PRO+ Return only the refined Twitter-Text in German plus.
$$PRO+ Add at the end Linefeed aand then Space-Separted Hashtags $crlf$
RET.
'===========================================================
'
'===========================================================
' Currently not used.
:NotAus
' Not AUS
IEK.LSHIFT
MBX.Ending
END.
EIF.
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
'===========================================================
' Firefox - Library Sub-Programmes
'===========================================================
'
: %Locate_TW 0
GSB.Loc_TW
END%
:Loc_TW
NEW.$$HWN
STW.ct|MozillaWindowClass|Mozilla Firefox
GSB.Resize_FF
HTV.$$HWN
ELS.
STW.h|$$HWN
GSB.Resize_FF
EIF.
RET.
'-----------------------------------------------------------
:Resize_FF
'SWP.0,0|1840,1944|T
SWP.0,0|1368,1829|T
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
' Kann ohne Parameter aufgerufen werden,
' oder mit einem Parameter mit dem Link für die neue Site
'
: %New_TAB 0
#IF PARAMS=1
SAV.Save|$$LNA
VAR.$$LNA=§§§01
GSB.New_TAB
PAU.1
%Firefox_Set_Site $$LNA
SAV.Restore
#EIF
#IF PARAMS=0
GSB.New_TAB
#EIF
END%
'-----------------------------------------------------------
:New_TAB
GSB.Loc_TW
AGR.43!WII.MLI.|Einen neuen Tab öffnen (Strg+T)||1|3|60
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
'
: %Firefox_Set_Site 1
SAV.Save|$$TXT
GSB.Set_Site|§§§01
SAV.Restore
END%
:Set_Site
VAR.$$TXT=§§_01
GSB.Loc_TW
AGR.43!WII.MLI.|Startseite||1|3|60
NAV.Rr|R|42
MLI.
KBC.Paste Over|$$TXT
SKP.{Enter}
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
'
' P1 - Text that is on the TAB we want
' P2 - optional the number of the TAB if it has the same Text like on other TABs
' normally Nr. is 1
' The minimum Number of Parameters is 1 thats why we have a "1" here after The Macroname
'
: %Locate_TAB 1
SAV.Save|$$NUM|$$TXT
VAR.$$TXT=§§§01
#IF PARAMS=1
VAR.$$NUM=1
GSB.Loc_TAB
#EIF
#IF PARAMS=2
VAR.$$NUM=§§§02
GSB.Loc_TAB|§§§01
#EIF
SAV.Restore
END%
'-----------------------------------------------------------
:Loc_TAB
GSB.Loc_TW
AGR.42!WII.MOS.|$$TXT||$$NUM|3|60
GSB.Loc_TW
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
'
: %Firefox 1
GSB.Lab_Run_Firefox|§§§01
END%
'-----------------------------------------------------------
:Lab_Run_Firefox
SAV.Save|$$PAT|$$NAM|$$RES|$$EXE|$$LNK
'-----------------------------------------------------------
IAI.Mozilla Firefox
VAR.$$LNK=§§_01
GSB.Lab_FF_starten
ELS.
MBX.Firefox ist nicht installiert.
END.
EIF.
RET.
:Lab_FF_starten
STW.ctwXo|MozillaWindowClass|Mozilla Firefox|1|Run_it
RET.
'-----------------------------------------------------------
:Run_it
VAR.$$NAM=$tos$
GII.$$NAM|$$RES|u
BLB.$$RES|$$RES
BLB.$$RES|$$RES
' $$PAT enthält Programmpfad ohne "\"
VAR.$$PAT=$$RES
VBT.$$PAT|"
VAR.$$EXE=$$PAT\Firefox.exe
IEF.$$EXE
EXE.$$EXE|$$LNK
ELS.
MBX.Kann FF nicht starten.
END.
EIF.
SAV.Restore
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
: %Firefox_Close 0
GSB.Lab_Close_FF
END%
:Lab_Close_FF
GSB.Loc_TW
CLW.$$HWN
STW.ct|MozillaDialogClass|schließen?&OR:close
' AGR. uses a waiting time of 60 seconds, you can change it below.
AGR.43!WII.MOS.|Tabs schließen&OR:close||1|3|60
MLI.
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------