;'God - Command' skill script

;SendMessageToAll("Test",#MSG_SAY)

PlayerMessage=GetUserMessage(#USERID)

Command="help"
Param1="0"
Param2="0"
Param3="0"

TextString="NoString"

EMPTY=""
MESSAGE="<message>"

;SendMessageToUser(#USERID,PlayerMessage,#MSG_SAY)

;GoTo PREPARSE
;>>>>>>>>>>>>>>>>>>>>>>>>>>>
;Label PREPARSE

beginQuote=FindString(PlayerMessage,"'",0)
If beginQuote = 0
	GoTo BEGINPARSE
EndIf

endQuote=FindString(PlayerMessage,"'", beginQuote+1)
If endQuote = 0
	GoTo BEGINPARSE
EndIf

finalQuote=FindString(PlayerMessage,"'", endQuote+1)
While finalQuote <> 0
	endQuote=finalQuote
	finalQuote=FindString(PlayerMessage,"'", endQuote+1)
Wend

TextString=SubString(PlayerMessage,beginQuote+1,endQuote-beginQuote-1)

FirstHalf=SubString(PlayerMessage,0,beginQuote-1)
SecondHalf=SubString(PlayerMessage,endQuote+1,Len(PlayerMessage)-endQuote)

PlayerMessage=FirstHalf+MESSAGE+SecondHalf

;GoTo END

;GoTo BEGINPARSE
;>>>>>>>>>>>>>>>>>>>>>>>>>>>
Label BEGINPARSE

;SendMessageToUser(#USERID,PlayerMessage,#MSG_SAY)

space1=FindString(PlayerMessage," ",0)
space2=FindString(PlayerMessage," ",space1+1)
space3=FindString(PlayerMessage," ",space2+1)
space4=FindString(PlayerMessage," ",space3+1)

;>>>>>>>>>>>>>>>>>>>>>>>>>>>

If space1 = 0
	Command=PlayerMessage
	GoTo ENDPARSE
EndIf
Command=SubString(PlayerMessage,0,space1-1)

If Command=EMPTY
	Command="help"
EndIf

;>>>>>>>>>>>>>>>>>>>>>>>>>>>

If space2 = 0
	Param1=SubString(PlayerMessage,space1+1,Len(PlayerMessage)-space1)
	GoTo ENDPARSE
EndIf
Param1=SubString(PlayerMessage,space1+1,space2-space1-1)

If Param1=EMPTY
	Param1="0"
EndIf

;>>>>>>>>>>>>>>>>>>>>>>>>>>>

If space3 = 0
	Param2=SubString(PlayerMessage,space2+1,Len(PlayerMessage)-space2)
	GoTo ENDPARSE
EndIf
Param2=SubString(PlayerMessage,space2+1,space3-space2-1)

If Param2=EMPTY
	Param2="0"
EndIf

;>>>>>>>>>>>>>>>>>>>>>>>>>>>

If space4 = 0
	Param3=SubString(PlayerMessage,space3+1,Len(PlayerMessage)-space3)
	GoTo ENDPARSE
EndIf
Param3=SubString(PlayerMessage,space3+1,space4-space3-1)

If Param3=EMPTY
	Param3="0"
EndIf

;>>>>>>>>>>>>>>>>>>>>>>>>>>>

Label ENDPARSE

If Param1=MESSAGE
	Param1=TextString
EndIf
If Param2=MESSAGE
	Param2=TextString
EndIf
If Param3=MESSAGE
	Param3=TextString
EndIf

Timer5(523,100,#USERID,Command,Param1,Param2,Param3)

;GoTo END
;>>>>>>>>>>>>>>>>>>>>>>>>>>>

;>>>>>>>>>>>>>>>>>>>>>>>>>>>
Label END

Continue = 1
