char message[255]//This is what the text you typed in will be stored as.
strcpy(message, "");//This will clear the message
strcpy(text, message);//This will show the message to you
if(getLastKey() >= 97 && getLastKey() <= 122)
{
strcat(message, getKeyText(getLastKey()));
}
else if(getLastKey() == 8)
{
int i;
for(i = 0; i < 255; i++)
{
if(message[i] == 0)
{
message[i - 1 * (i > 0)]=0;
break;
}
}
}
lcl wrote:I'll explain this to you later today, it's actually really easy
lcl wrote:@SuperSonic: that's text inputting function but what Hblade wanted was typewrite effect
lcl wrote:Anyway, that your code is quite nice, but it still has one flaw; if you press many keys at the time, it lags.
Kinda hard to explain but you'll see it when you type fast.
lcl wrote:And btw, Super, instead of 8 you can just write KEY_BACKSPACE, it's predefined to be 8.
int counter;
char temp[256], type[256];
temp[i] = NULL;
typewrite("Hello! This works! :DD");
SuperSonic wrote:lcl wrote:@SuperSonic: that's text inputting function but what Hblade wanted was typewrite effect
Oh, my bad
SuperSonic wrote:lcl wrote:And btw, Super, instead of 8 you can just write KEY_BACKSPACE, it's predefined to be 8.
Oh cool. I had no idea. Are there any others like that?
int counter;
char temp[256], type[256];
void TypeWrite(char input[256]) {
int i2
for(i2=0;i2<256;i2++) {
temp[i2]=NULL;
type[i2]=NULL; }
}
counter=0;
}
TypeWrite("Message o3o? %d", VARIABLE_HERE);
char MYTEMP[256];
sprintf(MYTEMP, "message with integer: %i", myInteger);
typewrite(MYTEMP);
int counter;
char temp[800], type[800];
void TypeWrite(char input[800]) {
int i2;
for(i2=0;i2<800;i2++) {
temp[i2]=NULL;
type[i2]=NULL; }
counter=0; //Set input to 0 and
strcpy(input,temp); // Copy input to temp
}
char MYTEMP[800];
if(counter<strlen(temp)) {
type[counter]=temp[counter];
counter++;
}
sprintf(text, type);
sprintf(MYTEMP, "Reiko's Level: %d\nReiko's EXP: %d\nTo next level: %d\n\nReiko's Attack: %d\nReiko's Defense: %d\nReiko's Magic: %d\nReiko's Speed: %d\nReiko's Luck: %d", PlayerLEVEL, PlayerEXP, TO_NEXT, PlayerATK, PlayerDEF, PlayerMAG, PlayerSPD, PlayerLUCK);
GetEXPInfo(25, (.90*PlayerLEVEL));
GetStatusInfo((.26*PlayerLEVEL), (.22*PlayerLEVEL), (.15*PlayerLEVEL), (.22*PlayerLEVEL), (.15*PlayerLEVEL));
TypeWrite(MYTEMP);
You wrote:
- Code: Select all
strcpy(input,temp); // Copy input to temp
Ge documentation http://game-editor.com/docs/script_reference.htm wrote:strcpy: Copies the contents of str2 into str1. str2 must be a pointer to a null-terminated string. strcpy() function returns a pointer to str1.
char *strcpy(char *str1, const char *str2);
if(counter<strlen(temp))
{
type[counter]=temp[counter];
counter++;
}
Users browsing this forum: No registered users and 1 guest