Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/14/2023 in all areas

  1. Progress update, I have a good chunk of the battle system code knocked out. Moved some GUI controls around also. Need to draw and finish some more animations for performing selected actions. I have the battle panel working as far as action selections go, and it will switch the applicable options between attack and defense. Currently, the program waits for player input before proceeding (With attack and defense turns). For this battle mode, which I'm calling the "arcade mode" will be turn based battle, but on your defense turn, I plan to add a timer so if you goof around too long on your defense turn to decide to defend, attempt a dodge or take attack, the opponent will attack anyways, catching you off guard. I also have a rough mock up of the damage and stats calculation.
    1 point
  2. Please find a small Func and test utiltiy for doing reverse DNS lookups on a network Here is some history behind the FUNC I recently had a requirement at work incorporate a reverse dns lookup scanner into one of my Autoit programs. My first attempt was to use the UDF Function _TCPIpToName(ipaddress). This would work fine if there was a valid reply from the network but would take aprox 4.5 seconds per ip address if the FUNC timed out. This was way to slow as I had hundreds of potential ip addresses to scan. I needed to find a better way. Looking through the forums I found a useful post (http://www.autoitscript.com/forum/index.php?showtopic=63353) by forum member Fox2. This FUNC used the Windows command prompt PING utility and with a little tweaking, I managed to get the timeout to be much shorter than the UDF func above. This prompted me to experiment a bit further and I eventually managed to write a simillar function using the windows command prompt tool NSLOOKUP. The NSLOOKUP tool doesn't need to PING the network devices before resolving the names so it is quicker and produces less network traffic. Also, not all network devices are Pingable so NSLOOKUP should have a better hit rate. Anyway, here is my simple _ReverseDNS Func using NSLOOKUP New Version: Posted 8th August 2012 Added StderrRead command as suggested in Knollo's code (post #6) Func _ReverseDNS($IPAddress) Local $NSLookupCmd,$ResponseText,$X1,$X2 $IPAddress = StringStripWS($IPAddress,3) $NSLookupCmd = Run(@ComSpec & " /c nslookup "& $IPAddress, "", @SW_HIDE, $STDOUT_CHILD+$STDERR_CHILD) While 1 StderrRead($NSLookupCmd) If @error Then ExitLoop WEnd $ResponseText = StdoutRead($NSLookupCmd) If @error Then Return $x1 = StringInStr($ResponseText, "Name:") $x2 = StringInStr($ResponseText, "Address",0,-1) If $x1 > 0 and $x2 > 0 Then Return StringStripWS(StringMid($ResponseText, $x1 + 6, $x2 - $x1 - 6),3) Return "Unknown" EndFunc
    1 point
  3. This has now been fixed. For some reason my code in the OP had been corrupted !!
    1 point
  4. i know this post is some days old, the code above will not work in all cases because the io stream isnt treated right. this one is working better #include <Constants.au3> Func _nslookup($ip) Local $nsl_string_content[2],$RG=0,$LG=0,$nsl="" Local $nsl_string=Run(@ComSpec & " /c nslookup "&$ip, "", @SW_HIDE,$STDERR_CHILD + $STDOUT_CHILD) while 1 $nsl_string_err=StderrRead($nsl_string) if @error Then ExitLoop WEnd While 1 $nsl_string_content[0]=StdoutRead($nsl_string) if @error or $nsl_string_content[0]="" Then ExitLoop $nsl_string_content[1]=$nsl_string_content[0] WEnd $LG=StringInStr($nsl_string_content[1],"Name:",1,1) $RG=StringInStr($nsl_string_content[1],Chr(13),1,1,$LG+5) If $LG>0 and $RG>0 then $nsl=StringStripCR(StringStripWS(StringMid($nsl_string_content[1],$LG+5,$RG-$LG-5),8)) EndIf Return $nsl EndFunc
    1 point
×
×
  • Create New...