Jump to content

Sledgehammer

Members
  • Posts

    5
  • Joined

  • Last visited

Sledgehammer's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Okay, that sounds great! So nice to see your still working on this plugin Keep 'em versions coming - Cheers Sledge
  2. Thanks for the fast response. However, this does unfortunately not solve my problem. Let's pretend I've added a texture located at C:\texture.bmp I've done the nescesary initialization, in order to bind the texture to my shape. If I then, during runtime that is, overwrite C:\texture.bmp with a file of the same name, but with a diffrent image, and then once again try to bind the same texture, using TextureBind, I don't see any change on my shape? Is there anyways I can somehow reload the texture, without having to chance Texture buffer, and the ID of the texture?
  3. Hey there Percy Big fan of your plugin, been following it for a while, although I haven't been a registred member of this community. I have a question for you; Is it somehow possible to change a texture on an object on runtime, or somehow update the texture on runtime, if the texture file changes, but with the path the same? Thank in advance - Sledge
  4. This does not solve my problem unfortunately. I'm wondering if this has anything to do with the $MaxLenght which I've in this case set to 2048. Last run i noticed that the destination file would never go above 2048 bytes. Also, when the Client views the message box "Connected", connected is also copied to that file?
  5. Greetings everyone. I'm new in scripting AutoIt, and therefore you'll have to excuse my ignorance. I'm trying to learn this language, so please be gentle. I'm also a user of Multimedia Builder, which I've been using for over some years now to script various programs. Now, to the point - I'm in the development of a Multiplayer Game (2 players only) in MMB. For this I'll of course need communications between to MMB application, via local area network. I could do this in a stupid way without 3rd party programs; however I've decided to make TCP functions for this, which unfortunately is not supported by MMB. So I've been studying some TCP scripting by AutoIt Smith (thank you very much). The core purpose of my AutoIt Script is to open a connection between the Host of the game, and the Joining Player (or to say; Server and Client). The Server program will constantly update/send contents of "host.txt" (containing game variables) to the Client, and constantly receive "joined.txt" from the Client. The Client should contain the same function, just vice versa. However I've bumped into a problem; When the Host/Server sends the "host.txt" (from the host computer) info to the Client, the client must then overwrite this data, into the "host.txt" (on the client computer). In my case, each time the script loops, the contents are not overwritten to the target file, but added. So after a few loops, the destination file gets huge. I don't know what causes this. Please remember I'm a novice in Autoit These are my temporarily, unfinished scripts (again, so far based upon the script of AutoIt Smith), but I hope you can get the idea. So far the Server only sends, and the Client only receives. Host/Server: Global $MainSocket = -1 Global $ConnectedSocket = -1 Local $MaxConnection = 1; Maximum Amount Of Concurrent Connections Local $MaxLength = 2048; Maximum Length Of String Local $Port = 1000; Port Number Local $Server = @IPAddress1; Server IpAddress TCPStartup() $MainSocket = TCPListen($Server, $Port) If $MainSocket = -1 Then Exit MsgBox(16, "Error", "Unable to intialize socket.") While 1 If FileExists("host.txt") Then ; Send function $File = FileOpen("host.txt", 0) $SendData = FileRead($File) FileClose ($File) TCPSend($ConnectedSocket, $SendData) Local $SendData = "" EndIf $Data = TCPRecv($ConnectedSocket, $MaxLength) If $Data = "~bye" Then MsgBox(16, "Server", "Connection Terminated.") Exit ElseIf $Data <> "" Then ; Unconditional Receive MsgBox(0, "Server", $Data) EndIf If $ConnectedSocket = -1 Then $ConnectedSocket = TCPAccept($MainSocket) If $ConnectedSocket <> -1 Then ; Someone Connected TCPSend($ConnectedSocket, "Connected!") EndIf EndIf WEnd Func OnAutoItExit() If $ConnectedSocket <> - 1 Then TCPSend($ConnectedSocket, "~bye") TCPCloseSocket($ConnectedSocket) EndIf If $MainSocket <> -1 Then TCPCloseSocket($MainSocket) TCPShutdown() EndFunc;==>OnAutoItExit Joined Player/Client: Global $MainSocket Local $MaxLength = 2048 Local $Port = 1000 Local $Server = InputBox("Enter Server IP Adress", "Server IP:"); Server IpAddress TCPStartup() $MainSocket = TCPConnect($Server, $Port) If $MainSocket = -1 Then Exit MsgBox(16, "Client", "Unable to connect.") While 1 Local $Data= "" $Data = TCPRecv($MainSocket, $MaxLength) If $Data = "~bye" Then MsgBox(16, "Client", "Connection Terminated.") Exit ElseIf $Data <> "" Then ; Unconditional Receive MsgBox(0, "Client", $Data) ;Recieve Function $File = FileOpen("host.txt", 2) FileWrite("host.txt", $Data) FileClose ($File) EndIf WEnd Func OnAutoItExit() If $MainSocket <> - 1 Then TCPSend($MainSocket, "~bye") TCPCloseSocket($MainSocket) EndIf TCPShutdown() EndFunc;==>OnAutoItExit I hope all of this makes sense, and that someone can help me - Thanks in advance.
×
×
  • Create New...