Jump to content

Ryokem

Members
  • Posts

    205
  • Joined

  • Last visited

Posts posted by Ryokem

  1. @Ryokem

    I think this guy come from some company ...

    that SQL table and the website is really professionally design @_@

    he is learning how to make rathena script language that's why he is asking here

    Oh.. I'm actually studying SQL and databases at university at the moment, only half course done till now and honestly I can say that's not really something so advanced, what was really hard to do was just to find out every attribute of the table he used, but that's just boringly long more than difficult... He sure has some DB knowledges, but that's not really hard.

  2. I'm not really solving the problem, but I was wondering about some parts of your script...

    OnInit:
    initnpctimer;
    startnpctimer;
    end;
    }

    Uh? Why are you starting the timer with initnpctimer; and then starting back again with startnpctimer; ? You can't really start an already started timer lol.

    just use one. Better initnpctimer; as it automatically sets the npc timer to 0.

    - script cutrue_refill_auto  111,{ 

    I'm wondering about the 111 sprite. 111 is an invisible sprite that allows an npc to still be clickable (it appears the dialogue icon when scrolling the cursor over the npc location).

    But how can a clickable npc have no maps and no coords? This actually can work, but it can fall into weird server debugings.

    - script cutrue_refill_auto  -1,{ 

  3. actually your method is already correct ... though, I don't see why your script doesn't work

    Actually, I believe he is just setting the wrong coordinates.

    In his script, he is randomizing a value from 8 to 31 as X coordinate, while his position (centre of the map) has X = 60.

    His position is 10 cells far from the wall, so the item will be not generated in the area where he is.

    OnInit:
    while(1) {
    if( getmapusers("new_zone04") )
    	makeitem 969,1,"new_zone04",rand(50,70),rand(170,190);
    sleep 100;
    }
    end;

    I believe this code actually works fine, if the item 969 does actually exist.

  4. its working now.. thanks btw one more thing

    if( !checkvending() ){
     set @Hour,@Hour + 1;
     if( @Hour % 5 == 0 && #Day != gettime(4) ){
      getitem 7227,5;
      set #Day,gettime(4);
      dispbottom "Online 5 Hours continuously...gained 1 item for today.";
     }
    }
    

    the "@Hour % 5" the #5 red color if i set it to 1 it means they need to online for 1 hr ?

    Yeah. But then, set @Hour,@Hour + 1; becomes meaningless.

  5. announce strcharinfo(0) + " just entered PvP yoyo mode", 0;

    By the way, I have no idea what pvp yoyo mode is, so can ya be more specific please?

    Also, providing us with your script may help even more.

    EDIT:

    @darristan please be slower next time xD!

  6. Annie just said everything you need to correct your code.

    Anyway, just to add the general case to help you on this kind of structure..

    Is This The Correct Way of Writing This Type of Code?

    ( <condition> ) ? <note 1> : <note 2>

    Means: if <condition> is met, solve <note 1>; solve <note 2> otherwise.

    <note 1> and <note 2> actually must be of the same type (2 string or 2 integers about rA)

    Example with integers:

    set .@a, ( ( .@b == 2 ) ? 1 : 2 );
    // IF .@b == 2, .@a -> 1 else .@a -> 2

    Example with strings:

    mes " + ( ( .@b == 2 ) ? ".@b is equal to 2" : ".@b is NOT equal to 2" );

  7. According to what the others said, I believe this is still the best option given

    but it will just reset the characters who logs in. . . xD

    and i want it to reset only 3rd job characters as well as kagerou and oboro. . . and then it will give 167 skill points

    blame yourself.....you didnt mention about it .... /swt

    - script Sample -1,{
    OnPCLoginEvent:
    if( Class >= 4054 && !DONE && BaseLevel >= 150 && JobLevel >= 50){
    resetskill;
    set DONE,1;
    set SkillPoint,168;
    message strcharinfo(0),"Skill Resetted.";
    }
    end;
    }
    

  8. You can try this script:

    OnNPCKillEvent:
    if (BaseLevel >= 150)
     getexp - getmonsterinfo(killedrid,3), - getmonsterinfo(killedrid,4);
    end;
    

    Somehow feels like AnnieRuru gonna come in and shoots at me :P

    It's a nice solution, but that prevents the player to gain exp from killing monsters only, not from all other script sources (like quests, for example).

    Even if, I must agree there is no way to prevent a script command to work, unless the proper source modifications.

    its possible to make a script when a player is lvl 150 (max lvl 155) to disable exp gains ?

    You should be more detailed about "which" exp you want players not to gain: only EXP from killing monsters, only EXP from other script souurces, or both.

    • Upvote 1
  9. =================================================================================

    I'm Getting Some kind of Error on line 8.

    P.S : Im using a 3ceAm SVN files

    ================================================================================

    prontera,157,178,5<tab>script<tab>Sample<tab>757,{
    if ( getgmlevel() < 80 )
        end;
    mes "Input Player Name";
    if ( input( .@input$, 4, 23 ) ) {
    	mes "invalid name length";
    	close;
    }
    if ( .@nb == query_sql( "select name, online from `char` where account_id = ( select account_id from `char` where name = '"+ escape_sql(.@input$) +"' ) order by char_num", .@name$, .@online ) )
    	for ( set .@i, 0; .@i < .@nb; set .@i, .@i + 1 )
    		mes " > "+ .@name$[.@i] +" "+( ( .@online[.@i] )? "^00FF00[Online]" : "^FF0000[Offline]" )+"^000000";
    else
    	mes "No character found";
    close;
    }

    All credits @ AnnieRuru

    3 small changes done:

    input( .@input$, 4, 23 ) //The variable used in the sql command has no capital letter.
    .@nb == query_sql() //dual '=' needed for comparisons
    for ( set .@i, 0; .@i < .@nb; set .@i, .@i + 1 ) //Optimized for 3CeaM users (like him)

  10. if you think this is wrong ... then its rathena script engine error ?

    I dunno ... as I never learn any other programming language

    Nah, I just said rAthena is not C++ or other languages, that's all ^^ Just to let him know that not everything about the other programming languages is correct also on rAthena and viceversa. :P

    plss give me the conversion codes for the errors and the for set code on image number 2..... coz im a stupid person who cant understand even a simple variable changes............... thx in advanced

    The errors you are showing up are basically all the same.

    You can't change the value of a variable by a direct set if using 3CeaM unless you did implement it by yourself.

    So:

    <variable> = <value>; //This is not allowed in 3CeaM
    set <variable>, <value>; //This has the same meaning of the command above, but works in 3CeaM

    Same with your error:

    set .@size, getarraysize([...]);

    Also, line 61 (for cicle) presents the same error

    for( set .@i, 0; .@ i < .@size; set .@i, .@i + 1 )

  11. I understand if you say var++ doesn't work, but has to use set var, var +1;

    but why you say var = var + 1; ?

    Was speaking about 3CeaM as he said he was using it.

    prontera,152,191,5	script	woe	100,{
    while ( .@i < 5 )
    	mes "Counting "+ .@i++;
    close;
    }

    it works you know

    Does it? .@i is supposed to be 0 and .@i++ is supposed to do the following:

    1. execute the command in which it is called.

    2. Increase the variable .@i by 1.

    So where's the "0"? The code you wrote would be recognized as (++.@i) from all imperial programming languages, unless the variable starts from 1.

    Actually, the output should be "0 1 2 3 4".

    or have you messed up this rathena forum and eathena forum ? /hmm

    Sure it can be xD I always have both opened xD

  12. EDIT: ups! XD

    Commands like var++; will not work. You have to use the full version: var = var + 1;

    Plus, as people says, 3CeAM doesn't support direct variable settings, so set command is actually needed.

    set .@a, <value>;
    for( set .@i, 0; .@i < 10; set .@i, .@i + 1 ) //Just sample values.
    set .@a, .@a + 1;

×
×
  • Create New...