TwitterSK

Addon TwitterSK 1.0.3

  • 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 comminuty!

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

Nashoba

Addon Developer
Jan 27, 2017
42
43
0
24
Nashoba submitted a new resource:

TwitterSK - Control Twitter with Skript!

Source code: https://github.com/Nashoba24/TwitterSK
Examples: https://github.com/Nashoba24/WolvSK/blob/master/examples/twitter.sk

1) Go to https://apps.twitter.com/app/new and create a new application with name, description and website you want

2) Now go to https://apps.twitter.com/, select your application and click on the tab named "Keys and Access Tokens"

3) You can get here your consumer key...

Read more about this resource...
 
Can you healp me?
How to organize tweets in the menu, example:
Line-1
Line-2
Line-3
this is the code
code_language.skript:
command /news:
    trigger:
        if player is op:
            open chest with 5 rows named "&9Twitter" to player
            wait a tick
            set {tweets::*} to home timeline
            set {_i} to 0
            loop {tweets.save::*}:
                format slot {_i} of player with book named "&c%loop-index% - &e%twitterer of loop-value%" with lore "&9%text of loop-value%" to be unstealable
                add 1 to {_i}

Result
MrVAZgv.png



in twitter:
code_language.skript:
O Player: FilipeNock foi Banido do Servidor
Motivo: TestandoAPITwitter
Horario: 30/01/17 00:48
 
@Snow-Pyon
Code to send tweet
code_language.skript:
on command "/ban":
    set {_args::*} to arguments split at " "
    if size of {_args::*} = 3:
        tweet "Player: %{_args::1}% has banned%newline%Reason: %{_args::2}%%newline%Date: %now%"

UF7bLPm.png

zgcWzAS.png


Code to open menu:
code_language.skript:
command /news:
    trigger:
        if player is op:
            open chest with 5 rows named "&9Twitter" to player
            wait a tick
            set {tweets::*} to home timeline
            set {_i} to 0
            loop {tweets::*}:
                format slot {_i} of player with book named "&c%loop-index% - &e%twitterer of loop-value%" with lore "&9%text of loop-value%" to be unstealable
                add 1 to {_i}


Why should I create a topic for this? I'm in the discussion of the addon, and I'm talking about it
 
@FilipeNock you're actually requesting help with something about the addon, if the problem is something big (which doesn't seems to be the case, but you'll know this for the future), it'll just make the thread longer with no reason, that's why you should create a new thread for it.

Now, regarding your issue, it seems that the strange character that says "lf" in it is the one which split the message, if you could get that char and then do something like:
code_language.skript:
loop {tweets::*}:
    set {_currentTweet::*} to text of loop-value split by "that character"
    format gui slot (loop-index parsed as int - 1) of player with book named "%loop-index% - &e%twitterer of loop-value%" with lore "&9%join {_currentTweet::*} by ""||""%" to nothing

P.S: as you can see, in my code I used the "format gui slot" instead of the "format slot", it's because the format slot is so buggy and not recommended (even more in loops because some items disappear without waiting a few ticks) and that's why I used the "format gui slot" which is the new and better "format slot", it's from TuSKe, you should use it because it fixed the bugs that the format slot had and it's a lot more customizable, I recommend it. Here is the link of the resource here and the beta releases if you want see it:
https://forums.skunity.com/resources/tuske-custom-enchantments-gui-manager-and-more.16/
https://github.com/Tuke-Nuke/TuSKe/releases/tag/1.7-beta.3
 
@FilipeNock you're actually requesting help with something about the addon, if the problem is something big (which doesn't seems to be the case, but you'll know this for the future), it'll just make the thread longer with no reason, that's why you should create a new thread for it.

Now, regarding your issue, it seems that the strange character that says "lf" in it is the one which split the message, if you could get that char and then do something like:
code_language.skript:
loop {tweets::*}:
    set {_currentTweet::*} to text of loop-value split by "that character"
    format gui slot (loop-index parsed as int - 1) of player with book named "%loop-index% - &e%twitterer of loop-value%" with lore "&9%join {_currentTweet::*} by ""||""%" to nothing

P.S: as you can see, in my code I used the "format gui slot" instead of the "format slot", it's because the format slot is so buggy and not recommended (even more in loops because some items disappear without waiting a few ticks) and that's why I used the "format gui slot" which is the new and better "format slot", it's from TuSKe, you should use it because it fixed the bugs that the format slot had and it's a lot more customizable, I recommend it. Here is the link of the resource here and the beta releases if you want see it:
https://forums.skunity.com/resources/tuske-custom-enchantments-gui-manager-and-more.16/
https://github.com/Tuke-Nuke/TuSKe/releases/tag/1.7-beta.3
I did it, but I see that your method is easier thanks
code_language.skript:
command /news:
    trigger:
        if player is op:
            open chest with 5 rows named "&9Twitter" to player
            wait a tick
            set {tweets::*} to home timeline
            set {_i} to 0
            loop {tweets::*}:
                set {_test} to text of loop-value
                replace all "%newline%" with "||&9" in {_test}
                format slot {_i} of player with book named "&c%loop-index% - &e%twitterer of loop-value%" with lore "&9%{_test}%" to be unstealable
                add 1 to {_i}
 
  • Like
Reactions: Snow-Pyon