Jump to content
  • 0

Hourly Reward Script > Unknown syntax in Map Server


Amidamaru

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   2
  • Joined:  07/12/17
  • Last Seen:  

Hello everyone,
i need help with this script. It is written in my Map Server: [Error]: npc_parsefile: Unknown syntax in file 'path file' Line '1' Stopping...

and btw i am using this script

-    script    hourly_point_main    -1,{
    
    OnInit:
        .max_hour = 5;
        .duration = 90;
        .npc_name$ = strnpcinfo(3);
        bindatcmd "hourly",    .npc_name$ + "::OnCheck";
        end;
        
    OnClock0000:
        query_sql( "DELETE FROM acc_reg_num` WHERE `key` = '#daily_hour_count' AND `account_id` IN ( SELECT `account_id` FROM `char` WHERE `login` = 0 GROUP BY `account_id` ) " );
        addrid(0);
        #daily_hour_count = -1;
        
    OnUpdate:
        deltimer .npc_name$+"::OnUpdate";
        #daily_hour_count++;
        switch ( #daily_hour_count ) {
            case 1:
                #CASHPOINT += 1;
                getitem 512,1;
                break;
            case 2:
                #CASHPOINT += 2;
                getitem 512,2;
                break;
            case 3:
                #CASHPOINT += 3;
                getitem 512,3;
                break;
            case 4:
                #CASHPOINT += 4;
                getitem 512,4;
                break;
            case 5:
                #CASHPOINT += 5;
                getitem 512,6;
                break;
            default: break;
        }
        
    OnPCLoginEvent:
        if ( #daily_hour_count < .max_hour ) {
            @timer = gettimetick(2) + .duration;
            addtimer ( .duration * 1000 ), .npc_name$+"::OnUpdate";
        }
        if ( #daily_hour_count )    dispbottom "[ Hourly Rewards ] " + #daily_hour_count + "/" + .max_hour + " hour" + ((#daily_hour_count > 1)?"s":"") + " played!",0x9ae2d7;
        end;
        
    OnCheck:
        .@min = (@timer - gettimetick(2))/60;
        .@sec = (@timer - gettimetick(2))%60;
        dispbottom "[ Hourly Rewards ] Your next reward will be achieved in " +
                    ((.@min)?            "[ " + .@min + " ] minute"         + ((.@min > 1)?"s":""):"") +
                    ((.@min && .@sec)?    " and ":"") +
                    ((.@sec)?            "[ " + .@sec + " ] second"    + ((.@sec > 1)?"s":""):"") +
                    "!",0x9ae2d7;
        end;            
}

The code souce is from: @Haziel

i tried to copy and reloadnpc it came out like this

image.png.dbf7cf6ea8d02dbcb0c718e9eaf2dd32.png

Really appreciate for the help and sorry for the long post. 

 

 

Edited by Amidamaru
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

Seems like there are 4 blanc spaces instead of tabs.
 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   2
  • Joined:  07/12/17
  • Last Seen:  

alright, it's been fixed. thank you.

It was 4 Spaces instead of 1 Tab

Edited by Amidamaru
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...