Smart Package Robot Twitterbar - Complete Code

Started by Theo Gottwald, November 28, 2023, 01:37:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

Unleash the power of AI with the Smart Package Robot! 🤖✨ Attach the capabilities of top AI systems to any program or browser with ease. 🌐🔗 In this demo, I'm empowering Twitter with the Smart Package Robot's AI magic. 🐦💫 Speak your tweets instead of typing! 🗣�✍️

Plus, get instant rewrites, translations, Emojis and Hashtags and even rhymes on demand. 🔄🌍🎶

Want stunning images? The Smart Package Robot has you covered there too! 🖼�🎨
And that all is in the Code below.✍️
🎨🎶

The code snippet demonstrates the utilization of the new autoincrement variable feature 🔄, which is a variable that automatically increases its value with each use. It's initialized with the 'RIV.' command. 🚀

#Coding #AutoIncrement #ProgrammingTips #CodeSnippet #DeveloperTools #TechTalk 🧑�💻👩�💻💻⌨️🖱�🔢🆙


#SmartPackageRobot #AIRevolution #TechInnovation #TwitterAI #VoiceToText #LanguageTranslation #CreativeRhymes #DigitalArt #TechMagic #ArtificialIntelligence 🤖🌟🐦🌐🔗🗣�✍️🔄🌍🎶🖼�🎨

(Translated)
Entfessele der KI ihre Macht, mit des Smarten Paketboten Pracht! 🤖 Verknüpfe Top-KI's Fähigkeiten, mit Programmen, ohne Mühen, sogleich. 🌐 In dieser Demo, sieh, wie ich Twitter belebe, mit des Boten KI-Zauber, so erhebe. ✨ Sprich deine Tweets, statt zu tippen, lass die Worte einfach fließen! 🎙� Erhalte Neuschreibungen, Übersetzungen, gar Reime auf Abruf, ohne Mühen. 🔄🌍📝 Begehrst du atemberaubende Bilder? Der Smarte Paketbote hält sie bereit, immer milder. 🎨🖌�

#SmartPackageRobot #AIRevolution #TechInnovation #TwitterAI #VoiceToText #LanguageTranslation #CreativeRhymes #DigitalArt #TechMagic #ArtificialIntelligence 🤖🌐✨🎙�🔄🌍📝🎨🖌�

TwitterBar_02.png
TwitterBar_01.png
AI_Rewzept.png
'
'SPR Script-file: Twitterbar
'Purpose:
'Creation date: 11-11-2023 at 20:18:48
'===========================================================
'#EXE:?path\
'#SPI:ForceWrite
'#ICS:20
'
' COMMANDS:
' RUN FIREFOX and open Site www.fa2.de
' P1 - Site that should be opened
' %Firefox www.fa2.de
'
' Open a new TAB-Page
' P1 - Site to be opened
' P2 - optional - Number of site if multiple with same Text
' %New_TAB
'
' Locate the Firefox Mainwindow
' %Locate_TW
'
' Trage Link in Firefox ein
' P1 - Link to open
' %Firefox_Set_Site $$LNK
'
' Close Firefox
' %Firefox_Close

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
:Start
' Sample Click
%Locate_TW

' Start the Button-Bar
PIL.$$REA|01

' Make the PlugIn visible
PIS.$$REA|hide

' 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
PIS.$$REA|SetButtonsHSize|80
' Set text on Button 1 to 13
RIV.1
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. Dictate
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. Dict.Rh.
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. Rework
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. P. Comm.
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. N. Comm.
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. Fun.Comm.
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. To Rhyme
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. To Eng.
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. To Ger.
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. To Spa.
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. Undo Txt.
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. Pic S/R
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. Pic S/R
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. What is Pic.
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. Command
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. Dump ASC
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. Test
$$NUM=#aiv#
PIS.$$REA|sBt|$$NUM|$$NUM. Ende

' Will set the number of visible Buttons to 18
PIS.$$REA|SetButtonNumber|$$NUM
DBP.$$NUM Buttons created

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.

  JIZ.$$JMP|endloop
  :weiter 
  ' Button-Number
  VBT.$$BNU
  VBT.$$BME 
 
  RIV.1
  SCN.$$BNU
  CAN.#aiv#
    GSB.DoDictate
  CAN.#aiv#
    GSB.DoDictRh
  CAN.#aiv#
    GSB.DoRework
  CAN.#aiv#
    GSB.DoPosCom
  CAN.#aiv#
    GSB.DoNegCom
  CAN.#aiv#
    GSB.DoFunny
  CAN.#aiv#
    GSB.DoRhyme
  CAN.#aiv#
    GSB.ToEng
  CAN.#aiv#
    GSB.ToGer
  CAN.#aiv#
    GSB.ToSpan
  CAN.#aiv#
    GSB.Undo
  CAN.#aiv#
    GSB.DoPIA
  CAN.#aiv#
    GSB.DoPIB
  CAN.#aiv#
    GSB.WhatIs
  CAN.#aiv#
    GSB.DoCommand
  CAN.#aiv#
    GSB.DumpASC
  CAN.#aiv#
    GSB.Test 
  CAE.
    GTO.enz
  ESL.
 
  :endloop
  NEW.t
    BRK.
  EIF.
OOP.
:enz
END.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:Completion_Unicode
AIC.Set Model Completion|1
AIC.Ask Comp Unicode|$$PRO|$$RES
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:Completion
AIC.Set Model Completion|1
AIC.Ask Completion|$$PRO|$$RES
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:Chat
AIC.SetModel Chat|1
AIC.Ask Chat|$$PRO|$$RES
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:Chat_Unicode
AIC.SetModel Chat|5
AIC.Ask Chat Unicode|$$PRO|$$RES
RET.
'-----------------------------------------------------------
' Buttons
'-----------------------------------------------------------
:DoDictate
AIC.Dictate Letter|$$MYT
DBP.$$MYT
CLP.t|$$MYT|1
MSB.550|2
:overB1
RET.

:DoDictRh
GSB.DoDictate
GSB.DoRhyme
GTO.Beep
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoRework
CLP.r|$$MYT|1
$$KEP=$$MYT
GSB.Pro_02
$$PRO+ Text: $$MYT
GSB.Chat_Unicode
DBP.$$RES
'CLP.t|$$RES|1
MSB.660|2
MSB.660|2
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoPosCom
CLP.r|$$MYT
$$KEP=$$MYT
GSB.Pro_01|positive Comment
$$PRO+ Text: $$MYT
AIC.Set Model Completion|1
AIC.Ask Completion|$$PRO|$$RES
GTO.ClipBeep
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoNegCom
CLP.r|$$MYT
$$KEP=$$MYT
GSB.Pro_01|negative Comment
$$PRO+ Text: $$MYT
AIC.Set Model Completion|0
AIC.Ask Completion|$$PRO|$$RES
GTO.ClipBeep
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoFunny
CLP.r|$$MYT
$$KEP=$$MYT
GSB.Pro_03|very funny Comment
$$PRO+ Text: $$MYT
GSB.Chat_Unicode
UTA.$$RES
DBP.$$RES
'GTO.ClipBeep
MSB.660|2
MSB.860|1
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoRhyme
CLP.r|$$MYT
$$KEP=$$MYT
GSB.Pro_04
$$PRO+ Text: $$MYT
GSB.Chat_Unicode
UTA.$$RES
DBP.$$RES
MSB.660|2
MSB.860|1
RET.
'-----------------------------------------------------------
' To Eng.
'-----------------------------------------------------------
:ToEng
CLP.r|$$MYT
$$INS=EN
DLT.Translate Text Unicode|$$MYT|$$RES||$$INS
DBP.$$RES
GTO.Beep
'-----------------------------------------------------------
' To Germ.
'-----------------------------------------------------------
:ToGer
CLP.r|$$MYT
$$INS=DE
DLT.Translate Text Unicode|$$MYT|$$RES||$$INS
DBP.$$RES
GTO.Beep
'-----------------------------------------------------------
' To Span.
'-----------------------------------------------------------
:ToSpan
CLP.r|$$MYT
$$INS=SP
DLT.Translate Text Unicode|$$MYT|$$RES||$$INS
DBP.$$RES
GTO.Beep
'-----------------------------------------------------------
:ClipBeep
CLP.t|$$RES
:Beep
$$KEP=$$MYT
MSB.660|2
MSB.660|2
MSB.860|1
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
' Undo
'-----------------------------------------------------------
:Undo
'PRT. Was here with: $$BME
CLP.r|$$MYT
DBP.$$KEP
CLP.t|$$KEP
$$KEP=$$MYT
MSB.660|2
MSB.660|2
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoPIA
IVS.$$BME=P!
  ANA.From Clipboard|$$KEA 
  SBT.Saved to A
  PIS.$$REA|sBt|11|A OK! 
ELS.
  ANA.To Clipboard|$$KEA
  SBT.Restored from A
EIF.
MSB.560|2
MSB.860|2

RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoPIB
IVS.$$BME=P!
  SBT.Saved to B
  ANA.From Clipboard|$$KEB 
  PIS.$$REA|sBt|11|B OK!
ELS.
  ANA.To Clipboard|$$KEB 
  SBT.Restored from B
EIF.
MSB.560|2
MSB.860|2
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:WhatIs
$$KEC=3
$$FIL=?path\Temp.jpg
ANA.From Clipboard|$$KEC
ANA.Save|$$KEC|$$FIL
$$PRO=What is this picture? Please tell me as the german poet Schiller and Hashtags to the result.
AIC.Ask Vision|$$FIL|$$PRO|$$RES
GSB.ToClip
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DoCommand
CLP.r|$$MYT
$$KEP=$$MYT
GSB.Pro_05|$$MYT
MBX.$$PRO
AIC.Set Model Chat|1
AIC.Ask Chat|$$PRO|$$RES
DBP.$$RES
GTO.ToClip
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:DumpASC
CLP.r|$$MYT|1
PRT.$$MYT|h
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:Test
CLP.r|$$MYT|1
VAR.$$RES=$$MYT
CLP.t|$$RES|1
MSB.660|2
MSB.660|2
RET.
'-----------------------------------------------------------
'
'-----------------------------------------------------------
:ToClip
CLP.t|$$KEP
CLP.$$RES
MSB.660|2
MSB.660|2
DBP.$$RES
RET.

'-----------------------------------------------------------
: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 below and add emojis for Twitter.
$$PRO+ then add double Linefeeds for best readability.
$$PRO+ Finally add a Linefeed and then Add Hashtags and lots of Emojis for Twitter to the end of the text.
$$PRO+ Return only the refined Twitter-Post.
'$$PRO+ followed by a Linefeed and then 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 keeping the original language.
$$PRO+ Add to every Line Emojis that fit well.
$$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
$$POE=Goethe
$$PRO=Act as the Poet $$POE, yet keep the language original as it was.
$$PRO+ Refine the following Text as $$POE, keeping the sense and original language.
$$PRO+ Add to every Line Emojis that fit well.
$$PRO+ Return only the refined Twitter-Text with Emojis.
$$PRO+ Add at the end a Linefeed and then Space-Separted Hashtags $crlf$
RET.
'-----------------------------------------------------------
:Pro_05
$$PRO=§§_01
$$PRO+ Return only the refined Twitter-Text in German plus.
$$PRO+ Add at the end  Linefeed aand then Space-Separted Hashtags $crlf$
RET.
'-----------------------------------------------------------
:Pro_06
$$PRO=Mach mir ein Rezept mit edlem Gemüse, Pfeffer, etwas Käse, Butter. Achte auf Gesundheit und Nährstoffe.
$$PRO+ Dann agiere wie zwei Experten. Experte A ist Goethe, der dieses Rezept in einen Goethe-mäßigen Reim umwandelt. Experte B ist ein Deutschexperte, der diesen Goethe-Reim nochmal von den Wörtern her so korrigiert, dass es sich perfekt reimt. Den Reim, der dann herauskommt, gibt nochmal Goethe zur Korrektur und macht etliche Emojis rein und formatiere es schön mit Zeilenumbrüchen für Twitter.
RET.

'===========================================================
' Twitter specific-Sub-Programmes
'===========================================================

'-----------------------------------------------------------
:NotAus
' Not AUS
IEK.LSHIFT
  MBX.Ending
  END.
EIF.
RET.
'-----------------------------------------------------------
:NextPage
%Locate_TW
MLI.t|100,1000
SDA.{PGDN}
PAU.1
RET.

'-----------------------------------------------------------
'
'-----------------------------------------------------------



'===========================================================
' 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.
'-----------------------------------------------------------
'
'-----------------------------------------------------------