ID:170813
 
How would I go about, "Adding up text strings, the RIGHT way?" So far, I have tried this:

proc/GetCode()
var/A
var/B
var/C
var/D
var/E
var/F
var/COMBO
A = "[pick(Alphabet)]"
B = "[pick(Alphabet)]"
C = "[pick(Alphabet)]"
D = "[pick(Alphabet)]"
E = "[pick(Alphabet)]"
F = "[pick(Alphabet)]"
COMBO = (A + B + C + D + E + F)
client.SendPage("[COMBO] - [src] - prize","Lenox",mail=1,subject="Prize")
return


Where "Alphabet" is a pre-defined list. I've also tried:

proc/GetCode()
var/A
var/B
var/C
var/D
var/E
var/F
var/COMBO
A = "[pick(Alphabet)]"
B = "[pick(Alphabet)]"
C = "[pick(Alphabet)]"
D = "[pick(Alphabet)]"
E = "[pick(Alphabet)]"
F = "[pick(Alphabet)]"
COMBO = ("[A]" + "[B]" + "[C]" + "[D]" + "[E]" + "[F]")
client.SendPage("[COMBO] - [src] - prize","Lenox",mail=1,subject="Prize")
return


Which one SHOULD I do? Thanks for your help/time in advance.
with the COMBO = line, it's the same as above to my belief.
In response to Hell Ramen
Hell Ramen wrote:
with the COMBO = line, it's the same as above to my belief.

Aiight, well, I was just curious because I left this running for about 10 hours and had not received one email about it, or page for that matter.
hmmm, I wonder why you're not getting an error.

if this is just a proc, not a mob proc, client should be null.
In response to Airjoe
Airjoe wrote:
hmmm, I wonder why you're not getting an error.

if this is just a proc, not a mob proc, client should be null.

Well, that isn't the EXACT proc, but the exact proc IS a mob proc. I just created a small proc on the fly for an example.
For one, you're using the options argument as multiple arguments. It's a text string that is converted using text2params(). So you'd do this:

client.SendPage("Message here","Lenox","mail=1;subject=Prize")


Another way you could do that whole thing is to use associated lists:

mob/verb/getCode()
var/list/myList=list("A","B","C","D","E","F")
var/txtCombo
for(var/loopValue in myList) myList[loopValue] = "[pick(Alphabet)]"
for(var/loopValue in myList) txtCombo += "[myList[loopValue]]"
client.SendPage("[txtCombo] - [src] - prize","lenox","mail=1;subject=Prize!")


Hope that helps.

~>Volte
In response to Volte
Aiight, thanks for all the help ya'll, I think I understand now :P

[EDIT]

hrm..another question, is it possible to like, "suppress" the message that pops up for comfirmation after client.SendPage() ?
In response to Lenox
No, because it could be used for bad purposes.

e.g. Person A logs into your game. You use personA.SendPage() to page Person B with a mean message. That wouldn't be very good.
Lenox wrote:
How would I go about, "Adding up text strings, the RIGHT way?"

<code>proc/AddUpTextString(letters=6) var/string = "" for(letters, letters>0, letters--) string += pick(Alphabet) return string</code>

The proc's argument is the number of letters to have in the string. It will return the random string you wanted, for whatever reason.
In response to Foomer
The reason I really wanted client.SendPage() to be used is because I really can't rely on the players paging me some numbers/letters.