WSA_NBTCP.au3 (Windows Sockets API - Non-Blocking Transmission Control Protocol)
Version: 1.00
Type: UDF
This is an accumulation of WSA code from many sources and modified to suit myself.
These functions have been thoroughly tested using a Local Proxy Server, which
is about the most strenuous test you can use.
Includes my rendition of how a TCPRecv Timeout should work. Also includes a
timewait/timeout using Select for TCP Send, which works great for that function.
You will need a loop to use _WSA_TCPRecv(). An example will be forthcoming in a second post.
Functions:
#CURRENT_USER_FUNCTIONS
_WSA_Cleanup
_WSA_FormatMessage
_WSA_GetLastError
_WSA_TCPAccept
_WSA_TCPCloseSocket
_WSA_TCPConnect
_WSA_TCPListen
_WSA_TCPRecv
_WSA_TCPSend
#INTERNAL_FUNCTIONS
__TimeoutManager
__TimeoutReset
#EXTRA_FUNCTIONS
_WSA_GetAddrInfo
_WSA_GetHostByAddr
_WSAAsyncGetHostByName
_WSAAsyncGetHostByName_Callback
_WSA_GetNameInfo
Requirements:
- AutoIt Versions: 3.3.8.1 thru 3.3.15.0 (32Bit only).
- TCPStartup() at beginning of script on startup.
- TCPShutDown() and _WSA_Cleanup() on exit.
Download UDF: WSA_NBTCP.au3
You're just going about this totally wrong, these computers shouldn't be on the schools network they should be isolated to their own network, then give the students admin access to the computers. This way if they try to do something malicious they won't affect the school's network.
Doing it any other way is just going to be a huge disaster waiting to happen.
make your tasks individual scripts. compile them to exe and run through task scheduler built into windows. if you plan on running this on your phone then you will most likely will need to develop a scheduler
Once way is using StringSplit which create an array and then you can select the month.
#include <Date.au3>
;~ Substract one month from the current month
$newmonth = _DateAdd('M', -1, _NowCalcDate())
;~ Write the new date
If $newmonth <> 0 Then
$Temp = StringSplit($newmonth, '/')
$newmonth = $Temp[2]
EndIf
ConsoleWrite(@LF&@LF&$newmonth&@LF&@LF)
A couple of thoughts --
1) You could use _DateTimeSplit to get the separated month component after the initial _DateAdd.
2) You could try something like this --
$newmonth = (@MON = 1) ? 12 : @MON - 1
the only thing you missed was this
_GDIPlus_BitmapDispose($Map)
_GDIPlus_BitmapCreateFromFile requires that, and because of it, when you tried to delete the file, it's still in use and it's not deleted.
As for the rest of the files, you move them/rename, so when you try to delete, they dont exist.