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 


How to change the shape of mouse pointer
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Nov 30, 2019 1:21 am    Post subject: How to change the shape of mouse pointer Reply with quote

Change the style of the mouse pointer by loading the (.cur) image


My mouse shape.png
 Description:
 Filesize:  68.39 KB
 Viewed:  5818 Time(s)

My mouse shape.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25300
Location: The netherlands

PostPosted: Sat Nov 30, 2019 4:22 am    Post subject: Reply with quote

untested but something like:
Code:

cursor=executeCodeLocalEx("LoadCursorFromFileA","c:\\pass_over.cur")
UDF1.Cursor=cursor

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1261

PostPosted: Sat Nov 30, 2019 4:39 am    Post subject: Reply with quote

Normally, these features are authorized in "Form Designer".
But it does not work on the command line.
I think Dark Byte can understand the problem.

This code just didn't work:

Code:
UDF1.CELabel1.Cursor="crHandPoint" --or 'crHandPoint' or crHandPoint



Screenshot_5.jpg
 Description:
 Filesize:  151.83 KB
 Viewed:  5800 Time(s)

Screenshot_5.jpg



_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25300
Location: The netherlands

PostPosted: Sat Nov 30, 2019 5:05 am    Post subject: Reply with quote

cursor isn't a type but a handle
but there are some hardcoded cursor values like
handpoint which has value -21

these still need to be added to defines.lua

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Nov 30, 2019 5:42 am    Post subject: Reply with quote

Dark Byte wrote:
untested but something like:
Code:

cursor=executeCodeLocalEx("LoadCursorFromFileA","c:\\pass_over.cur")
UDF1.Cursor=cursor
It seems that there is no such function


Error.png
 Description:
 Filesize:  10.04 KB
 Viewed:  5790 Time(s)

Error.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25300
Location: The netherlands

PostPosted: Sat Nov 30, 2019 8:33 am    Post subject: Reply with quote

as usual, 7.0 only
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Nov 30, 2019 9:22 am    Post subject: Reply with quote

Dark Byte wrote:
as usual, 7.0 only
My ce7.0 test results are as follows。The mouse pointer style does not change


no chang.png
 Description:
 Filesize:  57.05 KB
 Viewed:  5771 Time(s)

no chang.png


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25300
Location: The netherlands

PostPosted: Sat Nov 30, 2019 9:26 am    Post subject: Reply with quote

print the result of cursor

is it 0 or nil?

and perhaps the windows api setCursor is needed (i never used custom cursers myself)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Nov 30, 2019 9:28 am    Post subject: Reply with quote

Dark Byte wrote:
print the result of cursor

is it 0 or nil?

and perhaps the windows api setCursor is needed (i never used custom cursers myself)
Printed out is a handle
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 32

Joined: 16 Feb 2017
Posts: 1261

PostPosted: Sat Nov 30, 2019 9:44 am    Post subject: Reply with quote

Dark Byte wrote:
cursor isn't a type but a handle
but there are some hardcoded cursor values like
handpoint which has value -21

these still need to be added to defines.lua


Thanks DB. This function was handy.
It's good that you think about fixing it again.

-------------------------------------------------

Note: Tested in 7.0. No error, but code doesn't work.
Windows 7, with the full path:

Code:
cursor=executeCodeLocalEx("LoadCursorFromFileA","C:\\Windows\\Cursors\\aero_link_l.cur")
UDF1.Cursor=cursor

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25300
Location: The netherlands

PostPosted: Sat Nov 30, 2019 9:45 am    Post subject: Reply with quote

right, apparently custom cursors are done using the Screens class which is not exposed at the moment

try ExecuteCodeLocalEx("SetCursor", cursor)

but i fear that even if it works it fails on the control

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sat Nov 30, 2019 10:08 am    Post subject: Reply with quote

Dark Byte wrote:
try ExecuteCodeLocalEx("SetCursor", cursor)l
It doesn't seem to work. The result of printing cursor is 0
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun Dec 01, 2019 1:01 am    Post subject: Reply with quote

I simply use this.

Code:
f = createForm()
f.cursor = -21   -- handpoint

-- This is list of cursor code for free pascal, Work in CE Lua
-- ===========================================================
-- crAppStart = -19
-- crArrow = -2
-- crCross = -3
-- crDefault = 0
-- crDrag = -12
-- crHandPoint = -21
-- crHelp = -20
-- crHourGlass = -11
-- crHSplit = -14
-- crIBeam = -4
-- crMultiDrag = -16
-- crNo = -18
-- crNoDrop = -13
-- crNone = -1
-- crSizeAll = -22
-- crSizeNESW = -6
-- crSizeNS = -7
-- crSizeNWSE = -8
-- crSizeWE = -9
-- crSQLWait = -17
-- crUpArrow = -10
-- crVSplit = -15
-- ===========================================================

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
.lua
Expert Cheater
Reputation: 1

Joined: 13 Sep 2018
Posts: 189

PostPosted: Sun Dec 01, 2019 2:39 am    Post subject: Reply with quote

Corroder wrote:
I simply use this
Do you know how to call styles outside the system
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25300
Location: The netherlands

PostPosted: Sun Dec 01, 2019 2:46 am    Post subject: Reply with quote

Code:

f=createForm()

cursor=executeCodeLocalEx("LoadCursorFromFileA","c:\\pass_over.cur")

f.OnMouseMove=function()
  ExecuteCodeLocalEx("SetCursor", cursor)
end

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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 can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites