Jump to content

icabit

Members
  • Content Count

    45
  • Joined

  • Last visited

Posts posted by icabit


  1.  

    change

    query_sql "SELECT `last_mac` FROM `login` WHERE `account_id`="+getcharid(3),.@lastmac1$;query_sql "SELECT `last_mac` FROM `login` WHERE `account_id`="+.@accid,.@lastmac2$;if(.@lastmac1$==.@lastmac2$) {
    into

    if ( query_sql( "select 1 from login where last_mac = ( select last_mac from login where account_id = "+ getcharid(3) +" ) and account_id != "+ getcharid(3), .@dummy ) ) {
    .

    .

    btw this kind of script uses way too many query_sql in a single npc click

    its better that you optimized the SQL query, like I did above ( squeezing 2 Sql_handle into 1),

    otherwise this script might produce lag when used on a live server

     


     

    example like the one below

    query_sql "SELECT `time` FROM `totaltime` WHERE `account_id`="+.@accid,.@rtime;//gets the time of the recruiterquery_sql "SELECT `time` FROM `totaltime` WHERE `account_id`="+getcharid(3),.@rtime2;//gets the the of the newbieif (.@rtime2>=.@rtime) //compare both times
    change into

    query_sql "select ( select time from totaltime where account_id = "+ getcharid(3) +" ) - ( select time from totaltime where account_id = "+ .@accid +" )", .@time_diff;if ( .@time_diff > 0 ) //compare both times ... if positive numbers

     

    thx annie ill test these things and try to understand how it works

    im noob with queries using athena style

     

     

    after checking out the things you gave me i learned something new :D

     

    now i can finally check if the mac address of the newbee has already have a recruiter

    so a mac address can only be recruited once :D

     

    into

     

    [cbox]if ( query_sql( "select 1 from totaltime where mac = ( select last_mac from login where account_id = "+ getcharid(3) +" ) and account_id != "+ getcharid(3), .@dummy ) ) {[/cbox]

     

    thx a lot annie!


  2. i basically have this script working but i want to improve it

    http://pastebin.com/gDrhMyU8

    this script that i made is composed of 3 npc's in one 
    freebies
    daily reward
    hourly reward

    and referral system

    line 325-337 checks if his recruiter has the same mac address

    i wanted to make additional query checks for harmony
    where you can check if the newbie is already recruited in his/her other account by checking if his current mac address is already registered in table 'mac' in totaltime table

     

    for freebies if newbee's mac address is already in the totaltime table then no freebies


  3. i saw this post on rathena http://rathena.org/b...-self-announce/

    i wonder why no one every released one

     

    I was bored and i was thinking of making something

    so i remembered that eamod has this feature

    so i made one for us smile.png

    i don't know how eamod did it but i just do it via script biggrin.png

     

    i know theres like 123123 maps out there

    but it was easy to get them all to work once you know a little bit of programming LOL

     

    it will announce to yourself where you are currently

    this will announce the map listed on mapindex in data folder smile.png

    so it wont announce something like iz_dun01

    it will announce it as undersea tunnel smile.png

    works on every map that is enabled by default in hercules

    but the script is quite simple and i suppose it will work with rathena and eathena too

     

    note: if you will encounter errors on your map server just simply look for it in the script and comment them or delete them. if you know how to enable those maps then do so. its yours to decide what you do

    note 2: i will only support major problems of the script

    note 3: you may modify it but don't remove the header

     

    check the attached picture for an example smile.png

     

    post-51-0-40239500-1378404336_thumb.jpg

    mapannounce.txt


  4.  
    setarray .@position$[1], "Head","Body","Left hand","Right hand","Robe","Shoes","Accessory 1","Accessory 2","Head 2","Head 3";	set .@menu$,"";	for( set .@i,1; .@i <= 10; set .@i,.@i+1 )	{		if( getequipisequiped(.@i) )			set .@menu$, .@menu$ + .@position$[.@i] + "-" + "[" + getequipname(.@i) + "]";		 set .@menu$, .@menu$ + ":";	}	set .@part,select(.@menu$);	 if(!getequipisenableref(.@part)) { // checks the item if not refine-able		mes "[" + getarg(0) + "]";		mes "I don't think I can";		mes "refine this item at all...";		close;	}// write the lines you want to execute if the item is refine-able below this this line 
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.