Code archives/Networking/Random ip generator

This code has been declared by its author to be Public Domain code.

Download source code

Random ip generator by Nebula2006
Useful function for making ping lists.
;
; Ip generator ()
; Spider ping list builder
; Made for a server simulation game
; Cromdesign
DebugLog ip_generator(-1,0,0,0)
DebugLog ip_generator(-1,Rand(0,999),7,0)
;
Function ip_generator$(a,b,c,d)
	; -1 = random
	Select a
		Case -1	
		a = Rand(0,999)
	End Select
	Select b	
		Case -1
		b = Rand(0,999)
	End Select
	Select c	
		Case -1
		c = Rand(0,999)
	End Select	
	Select d	
			Case -1
			d = Rand(0,999)
	End Select	
	out$ = a+"."+b+"."+c+"."+d
	Return out$
End Function

Comments

Vertex2006
Lol? You know, that a IPv4 - Address have 4 bytes and 1 byte have an range of 0 - 255?


Panno2006
why not use RND(999) ;)


Andres2006
the function is usefull for cracking the whole world:
; Hack the world

Global Msg$ = Input("Please enter the hack message: ")

While Not KeyHit(1)
	host$ = Rand(0, 255) + "." + Rand(0, 255) + "." + Rand(0, 255) + "." + Rand(0, 255)
	stream% = OpenTCPStream(host$, Rand(0, 255*255) * percent#)
	If stream% Then
		Print "Success -> " + host$
		WriteLine stream%, Msg$
		CloseTCPStream stream%
	Else
		Print "Failed ->  " + host$
	EndIf
Wend


Fixed the IP gen too


Code Archives Forum