TriggerHappy
...
- Reaction score
- 341
Heres a simple code i wrote that will generate a string. I have no idea what it could be used for but i was bored. Anyways it takes 1 argument Length. If you havent guessed , It will make the length of the string that long.
Code:
Example use :
Screenshot ( idk why....)
Code:
JASS:
function GenString takes integer length returns nothing
local string alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
local string array random[length]
local string GS = ""
local integer i = 0
local integer RI
loop
exitwhen i == length
set RI = GetRandomInt(1,52)
set random<i> = SubStringBJ(alpha,RI,RI)
set GS = GS + random<i>
set i = i + 1
endloop
call DisplayTextToForce( GetPlayersAll(), " " + GS)
endfunction</i></i>
Example use :
Code:
Generate
Events
Player - Player 1 (Red) types a chat message containing -gen as An exact match
Conditions
Actions
Custom script: call GenString(GetRandomInt(5,20))
Screenshot ( idk why....)