not working (please)

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ezmann!44

Member
Jul 2, 2017
35
1
0
Slot1 :
Name - 2017.10.07 00:12 - Hacking
Slot2:
Name 2017.10.07 00:30 - Hacking

How can I switch it around So newest is Slot 1?

code_language.skript:
    set {_result1::*} to objects in column "bann" from result of query "SELECT `bann` FROM `server_ban`.`history` WHERE uuid = '%{_punished}'s uuid%'" and close
    set {_result2::*} to objects in column "by" from result of query "SELECT `by` FROM `server_ban`.`history` WHERE uuid = '%{_punished}'s uuid%'" and close
    set {_result3::*} to objects in column "date" from result of query "SELECT `date` FROM `server_ban`.`history` WHERE uuid = '%{_punished}'s uuid%'" and close
    set {_result4::*} to objects in column "reason" from result of query "SELECT `reason` FROM `server_ban`.`history` WHERE uuid = '%{_punished}'s uuid%'" and close
    set {_slot} to 9
    loop {_result1::*}:
        set {_amount4} to {_result4::%loop-index%}
        set {_amount3} to {_result3::%loop-index%}
        set {_amount2} to {_result2::%loop-index%}
        set {_amount1} to loop-value-1
        if "%{_amount1}%" contains "Chat Offense":
            set slot {_slot} of {_executer}'s current inventory to book and quill named "%{_colorTitle2}%Chat Offense" with lore ""
            add 1 to {_slot}
        if "%{_amount1}%" contains "Hacking":
            set slot {_slot} of {_executer}'s current inventory to iron sword named "%{_colorTitle2}%Client Mod" with lore "%{_amount2}% - %{_amount3}% - %{_amount4}%"
            add 1 to {_slot}
        if {_slot} = 54:
            exit loop
If you know how to fix this, please help me. I know its MySQL and some people don't know it but its not the SQL part that is messing it up, the SQL part just gets information.

[doublepost=1499697980,1499642102][/doublepost]bump
 
Last edited:
Don't need bump, we are not roboter!

Bump only if post older than 24hours.
 
Don't delete your bump then bump again which you have done atleast twice today
 
I know bensku's fork has a built in function called
sort {list::*}
no idea if it handles dates or not though.
 
@Blobbyguy Can't understand this condition/effect: sort {_amount1}

Using dev 25
 
Last edited by a moderator:
Adrihun, your best bet is making a manual sort by converting dates to unix time
 
Because this is not full code... he just say you can sorted it (maybe), so you need look documentions, how look full code

http://skunity.com/search?search=sorted
That is RandomSK and he said it can be done with bensku's Skript, anyway -

will i need to sort all of the variables? so they don't get mixed up, right?
also where to download randomsk
----------------------------------------------------------------------------------

@Pikachu

im not adrihun Also..

So convert the variables like

convert date {_amount1} to unix

am i doing it right? (im on phone so cant go check)
----------------------------------------------------------------------------------
[doublepost=1499970120,1499956172][/doublepost]i will pay anyone $5 who can fix the script and send it to me
 
Status
Not open for further replies.