Rain408 Posted November 19, 2015 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 77 Reputation: 0 Joined: 05/23/15 Last Seen: June 4, 2017 Share Posted November 19, 2015 if (checkquest(60520) != -1) { if (checkquest(60521) != -1) { if (checkquest(60518) != -1) { Is there a way to compress it so i dont have to type the same thing over and over, and risk messing up with my else..... Because the code just looks ugly like that I was thinking it could look something like this. if (checkquest(60520 ll 60521 ll 60518) != -1) { Quote Link to comment Share on other sites More sharing options...
0 Azura Skyy Posted November 19, 2015 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 545 Reputation: 221 Joined: 03/01/13 Last Seen: January 2, 2023 Share Posted November 19, 2015 if (checkquest(60520) != -1) { if (checkquest(60521) != -1) { if (checkquest(60518) != -1) { Is there a way to compress it so i dont have to type the same thing over and over, and risk messing up with my else..... Because the code just looks ugly like that if (checkquest(60520) != -1 || (60521) != -1 || (60518) != -1)) { Should work fine; Not entirely sure it looks better this way, but if that is what you want to do. Actually looking at my own use of a similar format, it looks nice in script editor. Important side note.. in your post, when scripting 'or' || You use 'll' <- two lower case L's. You need to use '||' <- two shift+\ Regards, ~Azura Skyy Quote Link to comment Share on other sites More sharing options...
0 Rain408 Posted November 19, 2015 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 77 Reputation: 0 Joined: 05/23/15 Last Seen: June 4, 2017 Author Share Posted November 19, 2015 if (checkquest(60520) != -1) { if (checkquest(60521) != -1) { if (checkquest(60518) != -1) { Is there a way to compress it so i dont have to type the same thing over and over, and risk messing up with my else..... Because the code just looks ugly like that if (checkquest(60520) != -1 || (60521) != -1 || (60518) != -1)) { Should work fine; Not entirely sure it looks better this way, but if that is what you want to do. Actually looking at my own use of a similar format, it looks nice in script editor. Important side note.. in your post, when scripting 'or' || You use 'll' <- two lower case L's. You need to use '||' <- two shift+\ Regards, ~Azura Skyy Thank you. I had a couple question about your script. Checkquest(60520)= = 2 , why you set it equal to 2? Next question is if ($Questleve >0), what does that command do? I'm just curious to learn these things so I can become a better scripter. Quote Link to comment Share on other sites More sharing options...
0 Azura Skyy Posted November 19, 2015 Group: Members Topic Count: 49 Topics Per Day: 0.01 Content Count: 545 Reputation: 221 Joined: 03/01/13 Last Seen: January 2, 2023 Share Posted November 19, 2015 Thank you. I had a couple question about your script. Checkquest(60520)= = 2 , why you set it equal to 2? Next question is if ($Questleve >0), what does that command do? I'm just curious to learn these things so I can become a better scripter. Checking if a quest == 2 is just a check to make sure the quest is completed. The $Questlevel variable is my own variable in that script, whereby if it is set to 1, the script requires that players meet the base level requirement to do the quest (the full script is a quest skipper, so... toggles for level and item requirements). Not important to your situation I think. If you want to read more about variables, click here. Regards, ~Azura Skyy Quote Link to comment Share on other sites More sharing options...
Question
Rain408
Is there a way to compress it so i dont have to type the same thing over and over, and risk messing up with my else.....
Because the code just looks ugly like that
I was thinking it could look something like this.
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.