Jump to content

plankt

Members
  • Posts

    130
  • Joined

  • Last visited

Everything posted by plankt

  1. You can check if the player haven't moved in a set time interval, it's no safe bet that he/she is afk tho. For more information, look up: getmapxy, sleep2 and OnPCLoadMapEvent.
  2. The compare functions wants the variable type "string". It receives an integer. You can solve this by type-casting the variables from integer to string. Look at the green part. By adding an empty string, you make sure that it is a string:
  3. For Windows Vista/7. What OS are you using? You should in any OS be able to set owner and permission for the RO folder. Make sure your user has write permission.
  4. I've had that problem before. The problem is indeed with the .lua files and starting the .exe as admin worked for me.
  5. Make sure no files in the RO folder is read-only If that doesn't help, start RO as admin.
  6. Could you show the errors?
  7. If you don't want the dialogue open, you can add the green line. Switched place of the two orange lines to make sure the shop is attached before we call it. On each OnInit, the shops content is removed by: npcshopitem "quest_shop1",0,0; And no items are added after that.
  8. plankt

    problems

    If you only have the statement, only 1 command will be executed for each loop. Ex: for(...) mes "This will be looped"; mes "This will not be looped"; for(...) mes "This will be looped"; mes "This will not be looped"; If you surround the code with { } then all the code inside will be executed each loop. Ex: for(...){ mes "This will be looped"; mes "This will be looped"; } mes "This will not be looped";
  9. plankt

    problems

    For the first one, if you only want to announce once, then add the announce like below: for(set @i,@i+1; getarg(@i)!=0; set @i,@i+2) getitem getarg(@i),getarg(@i+1); announce "Yay, the player got items",bc_all; If you want it to announce for each item, change the for loop like this: (to make sure it does both commands for each loop) for(set @i,@i+1; getarg(@i)!=0; set @i,@i+2){ getitem getarg(@i),getarg(@i+1); announce "Yay, the player got another item",bc_all; } For the second one, you can add an announce, like I did in the first example, after the line which gives the item: getitem $CB_Prize[.@d], $CB_Prize[.@d+3]; // Add announce here
  10. What you're looking for could be: It will open a normal shop. You need to have that shop as a script already.
  11. -<tab>script<tab>Shop5<tab>-1,{ ... OnShop: ... }
  12. You can switch "OnPCLoginEvent" for: And use a temporary char variable to keep track of monsters killed, ex: // Increase the mobs killed by 1 set @mobskilled, @mobskilled+1; // If the user has killed less then 80 mobs, don't run the script if(@mobskilled < 80) end; // Then reset the variable so we can start counting again set @mobskilled, 0;
  13. plankt

    WoE Times

    The function gettime() returns only what you specify. gettime(3) will give you the hour only. Since you can only arrive at the if check at two possible times, 19:00 and 20:30, you only need to check for the days and that specific hour. OnClock1900: // Start time OnClock2030: // End time // Check for Sunday or Wednesday AND that it is starttime if((gettime(4) == 0 || gettime(4) == 3) && gettime(3) == 19) { I'm guessing you have an "end time check" at the end of that if. Make sure to change that check to something like this: // Check for Sunday or Wednesday AND that it is endtime if((gettime(4) == 0 || gettime(4) == 3) && gettime(3) == 20) {
  14. You can save the AID where the variable $HighestPoringPointsName$ is set. Then at OnTimer310000 you can attachrid and give the reward. Make sure to remove the price part from the standard NPC. For the second, change this: } initnpctimer; end; OnPCDieEvent: To this: } killmonsterall "quiz_01"; mapannounce "quiz_01","You have won, approach the Present For You Npc please.",0; enablenpc "Present For You"; stopnpctimer; end; OnPCDieEvent:
  15. Test with the array: setarray $Forbidden[0],1002; And you should only get a Poring. If that works, then it's the IDs that are wrong. If that does not work, then please post the whole script on http://upaste.me
  16. Ah, mistake from my part. Ignore what I said about the for-loop. Change: do { set .@guessrepeat, 0; set $monster, 1000 + rand(1,950); for (set .@k, 0; .@k <getarraysize($Forbidden); set .@k, .@k+1){ if ($monster == $Forbidden[.@k]){ set .@guessrepeat, 1; break; } } } while (.@guessrepeat); To set $monster, $Forbidden[rand(getarraysize($Forbidden))]; Note: It can ONLY choose ids from the $Forbidden array if you do this edit. That way you can have arrays with monsters and select from them, ex: setarray .@mvps, id1, id2, id3, ...; set $monster, .@mvps[rand(getarraysize(.@mvps))];
  17. I'd rather change set @failchance,rand(100); To set @failchance,100;
  18. Screenie: http://www.dotalux.com/ro/npclist/pics/1_m_smith.png
  19. I did answer that one in the previous thread you made. Reason for the error: The event 'OnPCKillEvent' is activated but the script isn't ended before reaching 'L_LadderMove'. It then reaches Which executes the error.
  20. Same error? Also, upload the updated script to www.upaste.me
  21. Find all those and change to where ... is the content
  22. plankt

    SQL Help

    Something like this: OnPCLoginEvent: // Get the data to array @VotePoints, since we only get 1 value it will be treated as a variable, .@n is amount of rows set .@n, query_sql("SELECT `points` FROM `cp_v4p_voters` WHERE `account_id` = '"+getcharid(0)+"'", @VotePoints); // If we got data if(.@n){ // Update his/her values to 0 query_sql("UPDATE `cp_v4p_voters` SET `points` = 0 WHERE `account_id` = '"+getcharid(0)+"'"); // Update the CASHPOINTS var set #CASHPOINTS, #CASHPOINTS+@VotePoints; } end; Check the variables, names and code before using.
  23. For the first error, you can get rid of it by adding "end;" before "L_LadderMove:". It should not, but could, affect the script. end; L_LadderMove: For the "Expected string" errors. You need to give the function the correct type of values for it to work. It expects an integer, gets a string. There's 2 ways to fix it. 1) Typecast, change ex: getstrlen(var) to getstrlen(""+var). You add an empty string to force it to turn in to a string. 2) Check if the function is needed at all. You send an integer in to the function atoi which is used to turn string to integers = not needed.
  24. This is called typecasting. You have an integer and using Lilith method, you turn it in to a string, since compare expects two strings. If you want to go the other direction, you can use *atoi() to turn a string in to an integer.
  25. Does it enter the label "OnEndInstance" at all? If it does, check if .@a$ is set to an empty string or the map name. The script or player might not be attached to an instance, in that case you could save the instance ID and supply to the script command. *has_instance("<map name>"{,<instance id>}); If you want an alternative to scanning all the IDs to check who is on the map, you can try to: *instance_warpall "<map name>",<x>,<y>{,<instance id>}; And have a reward NPC they can talk to, or activate an OnTouch on arrival.
×
×
  • Create New...