Scripting on Webclient
Moderator: Eowul
Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
Scripting on Webclient
I was wrote some scripts on webclient earlier and when I relog, some or all the scripts (or triggers and aliases contain the scripts) didn't saved and reverted back to it's original state - back to old scripts or newly created triggers and aliases are no longer exist although I pressed SAVE button and even <save> in game.
Can someone help me explain how the save mechanic in webclient works? Do I need to wait sometime or do something in order to make new scripts save on database of server?
P.s: A button inside script editor to remove all scripts inside a trigger or alias would be nice since I cannot mass delete scripts on mobile device and webclient system don't have re-order triggers and aliases function... yet!
Thank you!
Can someone help me explain how the save mechanic in webclient works? Do I need to wait sometime or do something in order to make new scripts save on database of server?
P.s: A button inside script editor to remove all scripts inside a trigger or alias would be nice since I cannot mass delete scripts on mobile device and webclient system don't have re-order triggers and aliases function... yet!
Thank you!
Orien are cute (Cool too) kender, if ya disagree with Orien, Orien agree with ya, Orien loves all ^bounce^
Re: Scripting on Webclient
Found the issue. You need to go Linkdeath then relog again, if you not Linkdeath then login with new tab and push the other tab out the issue will arise.
Also I'm working on some codes and need some help with syntax:
If (dark elf case:) I need to use (true) condition for the code to work and in (Maivia case:) I need to use (args[2]) for the code to work hench why my switch have 2 conditions but the problem is it only works in either cases, decided by first condition, not both at the same time. Example: I put (true) before (args[2]) so only (dark elf case:) works and (Maivia case:) will be false and return default value and vice versa... Any solutions for this?
Thank you!
Also I'm working on some codes and need some help with syntax:
Code: Select all
switch ((true) || (args[2])) {
case 'Maivia':
Loot_Maivia;break;
case (args[2].indexOf('dark elf') > -1):
Loot_Darkelf;break;
default:Loot_General;
Thank you!
Orien are cute (Cool too) kender, if ya disagree with Orien, Orien agree with ya, Orien loves all ^bounce^
Re: Scripting on Webclient
You need to change it into an if-else tree. Switch statements don't work like that (case can't be a condition, it has to be a specific value). Also, the switch argument has to be a value, not a condition. Default part of switch will fire if no match is found for any of the cases.Orien wrote:Found the issue. You need to go Linkdeath then relog again, if you not Linkdeath then login with new tab and push the other tab out the issue will arise.
Also I'm working on some codes and need some help with syntax:
If (dark elf case:) I need to use (true) condition for the code to work and in (Maivia case:) I need to use (args[2]) for the code to work hench why my switch have 2 conditions but the problem is it only works in either cases, decided by first condition, not both at the same time. Example: I put (true) before (args[2]) so only (dark elf case:) works and (Maivia case:) will be false and return default value and vice versa... Any solutions for this?Code: Select all
switch ((true) || (args[2])) { case 'Maivia': Loot_Maivia;break; case (args[2].indexOf('dark elf') > -1): Loot_Darkelf;break; default:Loot_General;
Thank you!
Code: Select all
switch(args[2]) {
case 'Maivia':
Loot_Maivia;
break;
default:
if (args[2].indexOf('dark elf') > -1) {
Loot_Darkelf;
} else {
Loot_General;
}
break;
}
Time is precious. Waste it wisely.
Re: Scripting on Webclient
My current script:
Did not thinking of using else-if in default!
Thank you for your answer Zhar!
Code: Select all
switch (args[2]) {
case ’name’:case 'description':loot;break;
default:variable = true;}
if (variable) {
switch (true) {
case (args[2].indexOf('description') > -1):loot;variable = false;break;
default:loot;}}
Thank you for your answer Zhar!
Orien are cute (Cool too) kender, if ya disagree with Orien, Orien agree with ya, Orien loves all ^bounce^
Re: Scripting on Webclient
Please break your code into more lines.
Why would you make a switch for true/false? This is not what switch is used for... And it's very non-optimal performance-wise.
And why the hell would you even use a switch if every single case yields the same result? (unless the actual code you posted is not the actual code...)
This does exactly the same thing that your code does:
Why would you make a switch for true/false? This is not what switch is used for... And it's very non-optimal performance-wise.
And why the hell would you even use a switch if every single case yields the same result? (unless the actual code you posted is not the actual code...)
This does exactly the same thing that your code does:
Code: Select all
switch (args[2]) {
case ’name’:
case 'description':
loot;
break;
default:
variable = !(args[2].indexOf('description') > -1);
loot;
break;
}
Time is precious. Waste it wisely.
Re: Scripting on Webclient
Hi Zhar!
It is just an example of my code not the actual one, thanks for your lesson now I know how suck my code is! Already switched back to your version after your first post.
It is just an example of my code not the actual one, thanks for your lesson now I know how suck my code is! Already switched back to your version after your first post.
Orien are cute (Cool too) kender, if ya disagree with Orien, Orien agree with ya, Orien loves all ^bounce^
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/