Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-18-2008, 12:37 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
If I remember correctly, random(start, end) will only return a random number within [start, end)

It's a bit different to generate a random character. Here's one way to generate a random upper-case letter:
PHP Code:
char(int(random(6591))); 
You can look at an ascii table to see where I get the 65 and 91 from. You could also look at an ascii table to get the ranges for lower-case letters.

Or, you could predefine an array of all the characters you want to include in your random strings, then use randomstring().
Example:
PHP Code:
temp.chars = {"A""B""C""D""a"123};  //Put all characters in here.
temp.confCode randomstring(temp.chars) @ randomstring(temp.chars) @ randomstring(temp.chars); 
And, to save as a log/*.txt file you can use savelog2
Example:
PHP Code:
savelog2("snaps.txt""The boy bought the basketball"); 
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 12:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.