Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Enable / Use VBScript code with CE. (Use voice message)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials
View previous topic :: View next topic  
Author Message
AylinCE
Grandmaster Cheater Supreme
Reputation: 30

Joined: 16 Feb 2017
Posts: 1234

PostPosted: Fri Jul 12, 2019 2:18 pm    Post subject: Enable / Use VBScript code with CE. (Use voice message) Reply with quote

==================== VBScript =================
Now some "C #" code (VBScript code language),
Without additional Program,
Let's activate it using CE Script.
Remember: This encoding is available to you in Windows,
It also allows you to create some scripts.
Examples are given below.
Please use this method for Good results. Wink
First paste the following first code in CE Scripte,
and save it as .CT.
Then proceed with the saved .CT.

Code:
local form = createForm(true) -- UDF1
form.Position = poDesktopCenter
form.Width = 320
form.Height = 400
form.caption = "Create VBScript Command"

local m1 = createMemo(form)
m1.Width = 300
m1.Height = 350
m1.Left = 10
m1.Top = 10
m1.ScrollBars = ssAutoBoth
m1.WordWrap = false


local b1 = createButton(form)
b1.Left = 130
b1.Top = 370
b1.caption = "Enable"
--------------------------------------------
local path = TrainerOrigin or getMainForm()

b1.OnClick = function() -- UDF1.CEButton1.OnClick
local index = 1
if path then
local settingsFile = io.open(path.."Script.vbs", "w")
    if (settingsFile ~= nil) then
      settingsFile:write(m1.Lines.Text)
      settingsFile:close()
shellExecute("Script.vbs")
    end
  end
end


Below are a few VBScript code.
Copy one and paste it into Memo and click "Enable".

------------------------- Browser and URL:-------------------------



Code:
Sub Item_Open()
   Set Web = CreateObject("InternetExplorer.Application")
   Web.Visible = True
   Web.Navigate "https://forum.cheatengine.org/viewtopic.php?t=610493"
End Sub
Item_Open()


------------------------ Input Box ----------------------------

Code:
dim a

a=InputBox("Do you like Cheesecake?:","title")

if a=("yes") Then

msgbox("YAY! I like cheesecake too!")

elseif a=("Yes") Then

msgbox("YAY! I like cheesecake too!")

elseif a=("No") Then

msgbox("Aww..... You suck. Cheesecake is the best!")

elseif a=("no") Then

msgbox("Aww..... You suck. Cheesecake is the best!")

else

msgbox("Enter yes or no!")

CreateObject("WScript.Shell").Run("""cheesecake.vbs""")

End If


-------------------------- Compare --------------------
Code:
if 200 > 16 then
msgbox ("200 is greater than 16")
else
msgbox ("200 isn't greater than 16")
end if


-------------- Input and Message Box ----------------
Code:
msgbox("Hello, Who are you?")
variable=inputbox("WRITE YOUR NAME HERE", "BOX1", "TYPE NAME HERE")
msgbox("Oh hi, I never saw you for a while.")
msgbox("I need a favour, Can you help me?")
x=msgbox("CHOOSE", 4+64, "BOX2")
msgbox("Good, Now press OK OR X.")
x=msgbox("...", 0+48, "BOX3")
msgbox("GOOD")
msgbox("Had a fun time together? I bet!")
msgbox("Oh no, I need to leave.")
variable=inputbox("BOX4", "Write your address here so we can meet any time", "TYPE ADDRESS HERE")
msgbox("We can meet sometime now. Bye. Also remove this loop message using TASK MANAGER. Have a good day.")
msgbox("<END>")


Note: Close; BOX4 Wink

------------------------ Voice Message ---------------------------
Code:
CreateObject("SAPI.SpVoice" ).Speak"I Love you Cheat Engine"


-------- This code will tell you your system information. ---------

Code:
' List Processor Information



strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colCSes = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem")
For Each objCS In colCSes
  WScript.Echo "Computer Name: " & objCS.Name
  WScript.Echo "System Type: " & objCS.SystemType
  WScript.Echo "Number Of Processors: " & objCS.NumberOfProcessors
Next
Set colProcessors = objWMIService.ExecQuery("Select * from Win32_Processor")
For Each objProcessor in colProcessors
  WScript.Echo "Manufacturer: " & objProcessor.Manufacturer
  WScript.Echo "Name: " & objProcessor.Name
  WScript.Echo "Description: " & objProcessor.Description
  WScript.Echo "Processor ID: " & objProcessor.ProcessorID
  WScript.Echo "Address Width: " & objProcessor.AddressWidth
  WScript.Echo "Data Width: " & objProcessor.DataWidth
  WScript.Echo "Family: " & objProcessor.Family
  WScript.Echo "Maximum Clock Speed: " & objProcessor.MaxClockSpeed
Next


---------- Generate this code as a ".vbs" script.
Paste into the file path I gave below
(Type the PC name in the "USERNAME" section)
Time: When it is 12 in Day and Night, it will give you audible warning.

File path to save the script:
C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Code:
Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
 Sapi.speak "The current time is"
if hour(time) > 12 then
 Sapi.speak hour(time)-12
 else
 if hour(time) = 0 then
 Sapi.speak "12"
 else
 Sapi.speak hour(time)
 end if
 end if
if minute(time) < 10 then
 Sapi.speak "o"
 if minute(time) < 1 then
 Sapi.speak "clock"
 else
 Sapi.speak minute(time)
 end if
 else
 Sapi.speak minute(time)
 end if

if hour(time) > 12 then
 Sapi.speak "P.M."
 else
 if hour(time) = 0 then
 if minute(time) = 0 then
 Sapi.speak "Midnight"
 else
 Sapi.speak "A.M."
 end if
 else
 if hour(time) = 12 then
 if minute(time) = 0 then
 Sapi.speak "Noon"
 else
 Sapi.speak "P.M."
 end if
 else
 Sapi.speak "A.M."
 end if
 end if
 end if



================== NOTE ===================
If you have VBScript code samples,
Please feel free to comment.
Entertainment should go on. Wink
==========================================

=========== Voice Message Trainer Version ==========

warning messages in Trainer, read aloud.
I'm sharing a code I've compiled from VB.
Hopefully the entertainment will continue.

This is the code we will use:

Code:
CreateObject("SAPI.SpVoice" ).Speak"I Love you Cheat Engine"


Of course, for now only in English.
In VB we would change the language like this:

Code:
<speak;
version = "1.0";
xmlns = "http://www.w3.org/2001/10/synthesis";
xml:
    langEnglish;
    ,press;
    1.<;
    voice;
xml:
    lang = "fr-FR";
    gender = ("female" > Pour);
    le;
    fran;
    ais;
    ,appuyez;
    sur;
    2voice/speak


or

https://docs.microsoft.com/en-us/previous-versions/office/developer/speech-technologies/jj127898(v=msdn.10)

Between you and me: An advanced master,
  I hope it adds the language pack to the current code. Wink

=====================================
Now let's move to the use of the code in CE.
For this we will get help from @mgr.inzPlayer:
(With @mgr.inz.Player's "saveSettings" registration code,
we will create a ".vbs" file. )

Note: To allow the Trainer to take the current path,
Paste the following code into CE Script,
Register on Desktop (.CT or Trainer)
Then open and use the .CT that you created.

Code:
local form = createForm(true) -- UDF1
form.Position = poDesktopCenter
form.Width = 420
form.Height = 170

local e1 = createEdit(form) -- UDF1.CEEdit1
e1.Left = 10
e1.Top = 10
e1.Width = 325
e1.Text = "I love you Cheat Engine"

local b1 = createButton(form) -- UDF1.CEEdit2
b1.Left = 340
b1.Top = 9
b1.caption = "Speak"

local e2 = createEdit(form) -- UDF1.CEButton1
--e1.Height = 24
e2.Left = 10
e2.Top = 60
e2.Width = 325
e2.Text = "Error! Hack is not activated."

local b2 = createButton(form) -- UDF1.CEButton2
b2.Left = 340
b2.Top = 59
b2.caption = "Message"

local b3 = createButton(form) -- UDF1.CEButton3
b3.Left = 155
b3.Top = 100
b3.Width = 90
b3.caption = "Local Message"

local l1 = createLabel(form) -- UDF1.CELabel1
l1.Left = 10
l1.Top = 135
l1.caption = "Local Message.."
l1.visible = true -- or false ;)
------------------------------------------
local path = TrainerOrigin or getMainForm()

b1.OnClick = function() -- UDF1.CEButton1.OnClick
local index = 1
if path then
local settingsFile = io.open(path.."Speak.vbs", "w")
    if (settingsFile ~= nil) then
      settingsFile:write([[CreateObject("SAPI.SpVoice" ).Speak"]]..e1.Text..[["]])
      settingsFile:close()
shellExecute("Speak.vbs")
    end
  end
end

b2.OnClick = function() -- UDF1.CEButton2.OnClick
local index = 1
if path then
local settingsFile = io.open(path.."Speak.vbs", "w")
    if (settingsFile ~= nil) then
      settingsFile:write([[CreateObject("SAPI.SpVoice" ).Speak"]]..e2.Text..[["]])
      settingsFile:close()
shellExecute("Speak.vbs")
      showMessage(e2.Text)
    end
  end
end

function LocalMessage(sender)
local index = 1
if path then
local settingsFile = io.open(path.."Speak.vbs", "w")
    if (settingsFile ~= nil) then
      settingsFile:write([[CreateObject("SAPI.SpVoice" ).Speak"]]..l1.caption..[["]])
      settingsFile:close()
shellExecute("Speak.vbs")
      showMessage(l1.caption)
    end
  end
end

b3.OnClick = function() -- UDF1.CEButton3.OnClick
l1.caption = "Successful. Hack was activated."
LocalMessage()
end


and Tutorial Video:


Link


Enjoy it ! Wink
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites