[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Refresh Variables registered to the luaVM
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Refresh Variables registered to the luaVM

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Dr. C   (1 post)  [Biography] bio
Date Thu 07 Apr 2011 10:33 AM (UTC)

Amended on Thu 07 Apr 2011 12:02 PM (UTC) by Dr. C

Message
Hello everyone!

Ive written a program (in C#) that reads gamevalues from memory and registers them to a luaVM.

luaVM["PlayerX"] = memory.values[3];

Like this. Since the position of the player figure changes all the time, I keep the values updated every 150ms.

while true
{
luaVM["PlayerX"] = memory.values[3];
.....
Thread.Sleep(150);
}

But I receive a SEHException (no further information) sooner or later. The time from starting the script to recieving the exception varies, and doesnt seem to be coupled with a certain event.

Visual studio doesnt tell me more, so I am a bit helpless. I think this could be somekind of overflow exception, I dont know. And I think that maybe the way of refreshing the variables to the luaVM is not right in a way. But I cannot see a better way to do this.

EDIT: The method that throws the exception seems to be:
Void lua_pushstring(IntPtr, System.String)
Doesnt tell me much..

Anyways I would be very thankful for any help.

Here what I get:
http://s7.directupload.net/file/d/2487/prmrqosv_jpg.htm
(0 is the Marshal.GetLastWin32Error)
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 07 Apr 2011 10:11 PM (UTC)
Message
Dr C said:

Ive written a program (in C#) that reads gamevalues from memory and registers them to a luaVM.


I don't really understand this. Is this MUSHclient we are talking about?

In any case, I don't know that using threads is going to work too well in Lua (I would use coroutines).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,729 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]